Open CASCADE Technology 7.9.0
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_VertexVertex (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Vertex.
 
TopoDS_VertexVertex (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Vertex.
 
const TopoDS_EdgeEdge (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Edge.
 
TopoDS_EdgeEdge (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Edge.
 
const TopoDS_WireWire (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Wire.
 
TopoDS_WireWire (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Wire.
 
const TopoDS_FaceFace (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Face.
 
TopoDS_FaceFace (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Face.
 
const TopoDS_ShellShell (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Shell.
 
TopoDS_ShellShell (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Shell.
 
const TopoDS_SolidSolid (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Solid.
 
TopoDS_SolidSolid (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Solid.
 
const TopoDS_CompSolidCompSolid (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, CompSolid.
 
TopoDS_CompSolidCompSolid (TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, CompSolid.
 
const TopoDS_CompoundCompound (const TopoDS_Shape &theShape)
 Casts shape theShape to the more specialized return type, Compound.
 
TopoDS_CompoundCompound (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.