Open CASCADE Technology 7.9.3
Loading...
Searching...
No Matches
TopoDS Namespace Reference

Provides methods to cast objects of class TopoDS_Shape to more specialized sub-classes. The types are not verified before casting. If the type does not match, a Standard_TypeMismatch exception is thrown. Below are examples of correct and incorrect casts: More...

Functions

const TopoDS_Vertex & Vertex (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Vertex.
TopoDS_Vertex & Vertex (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Vertex.
const TopoDS_Edge & Edge (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Edge.
TopoDS_Edge & Edge (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Edge.
const TopoDS_Wire & Wire (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Wire.
TopoDS_Wire & Wire (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Wire.
const TopoDS_Face & Face (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Face.
TopoDS_Face & Face (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Face.
const TopoDS_Shell & Shell (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Shell.
TopoDS_Shell & Shell (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Shell.
const TopoDS_Solid & Solid (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Solid.
TopoDS_Solid & Solid (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Solid.
const TopoDS_CompSolid & CompSolid (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, CompSolid.
TopoDS_CompSolid & CompSolid (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, CompSolid.
const TopoDS_Compound & Compound (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Compound.
TopoDS_Compound & Compound (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Compound.

Detailed Description

Provides methods to cast objects of class TopoDS_Shape to more specialized sub-classes. The types are not verified before casting. If the type does not match, a Standard_TypeMismatch exception is thrown. Below are examples of correct and incorrect casts:

Correct:

TopoDS_Shape aShape = ...; // aShape->ShapeType() == TopAbs_VERTEX
const TopoDS_Vertex& aVertex = TopoDS::Vertex(aShape);
Describes a shape which.
Definition TopoDS_Shape.hxx:41
Describes a vertex which.
Definition TopoDS_Vertex.hxx:31
const TopoDS_Vertex & Vertex(const TopoDS_Shape &theShape)
Casts shape theShape to the more specialized return type, Vertex.
Definition TopoDS.hxx:70

Incorrect (will throw a Standard_TypeMismatch exception):

TopoDS_Shape aShape = ...; // aShape->ShapeType() == TopAbs_VERTEX
const TopoDS_Face& face = TopoDS::Edge(aShape);
Describes a face which.
Definition TopoDS_Face.hxx:30
const TopoDS_Edge & Edge(const TopoDS_Shape &theShape)
Casts shape theShape to the more specialized return type, Edge.
Definition TopoDS.hxx:94

Function Documentation

◆ Compound() [1/2]

const TopoDS_Compound & TopoDS::Compound ( const TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Compound.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Compound
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Compound() [2/2]

TopoDS_Compound & TopoDS::Compound ( TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Compound.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Compound
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ CompSolid() [1/2]

const TopoDS_CompSolid & TopoDS::CompSolid ( const TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, CompSolid.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_CompSolid
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ CompSolid() [2/2]

TopoDS_CompSolid & TopoDS::CompSolid ( TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, CompSolid.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_CompSolid
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Edge() [1/2]

const TopoDS_Edge & TopoDS::Edge ( const TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Edge.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Edge
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Edge() [2/2]

TopoDS_Edge & TopoDS::Edge ( TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Edge.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Edge
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Face() [1/2]

const TopoDS_Face & TopoDS::Face ( const TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Face.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Face
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Face() [2/2]

TopoDS_Face & TopoDS::Face ( TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Face.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Face
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Shell() [1/2]

const TopoDS_Shell & TopoDS::Shell ( const TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Shell.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Shell
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Shell() [2/2]

TopoDS_Shell & TopoDS::Shell ( TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Shell.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Shell
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Solid() [1/2]

const TopoDS_Solid & TopoDS::Solid ( const TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Solid.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Solid
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Solid() [2/2]

TopoDS_Solid & TopoDS::Solid ( TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Solid.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Solid
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Vertex() [1/2]

const TopoDS_Vertex & TopoDS::Vertex ( const TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Vertex.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Vertex
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Vertex() [2/2]

TopoDS_Vertex & TopoDS::Vertex ( TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Vertex.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Vertex
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Wire() [1/2]

const TopoDS_Wire & TopoDS::Wire ( const TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Wire.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Wire
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.

◆ Wire() [2/2]

TopoDS_Wire & TopoDS::Wire ( TopoDS_Shape & theShape)
inline

Casts shape theShape to the more specialized return type, Wire.

Parameters
theShapethe shape to be cast
Returns
the casted shape as TopoDS_Wire
Exceptions
Standard_TypeMismatchif theShape cannot be cast to this return type.