CAD Exchanger SDK
cadex::ModelData_Body Class Reference

Defines a root topological shape that can be owned by B-Rep representation. More...

Inheritance diagram for cadex::ModelData_Body:
cadex::ModelData_Shape

Public Member Functions

ModelData_BodyType BodyType () const
 Returns a body type. More...
 
bool Append (const ModelData_Shape &theShape)
 Adds a shape to the body. More...
 
- Public Member Functions inherited from cadex::ModelData_Shape
 ModelData_Shape ()
 Constructor.
 
 ModelData_Shape (const ModelData_Shape &theOther)
 Constructor.
 
 ModelData_Shape (ModelData_Shape &&theOther)
 Move constructor.
 
 ~ModelData_Shape ()
 Destructor.
 
ModelData_Shapeoperator= (const ModelData_Shape &theOther)
 Assignment operator.
 
ModelData_Shapeoperator= (ModelData_Shape &&theOther)
 Move assignment operator.
 
 operator const TopoDS_Shape & () const
 Casts this object to TopoDS_Shape. More...
 
ModelData_ShapeType Type () const
 Returns a shape type. More...
 
ModelData_ShapeOrientation Orientation () const
 Returns orientation flag. More...
 
ModelData_Shape Reversed () const
 Returns a shape that shares the same geometry and subshape graph but has opposite orientation. More...
 
ModelData_Shape Oriented (ModelData_ShapeOrientation theOrientation) const
 Returns a shape that shares the same geometry and subshape graph and has specified orientation. More...
 
void Nullify ()
 Nullifies the object. More...
 
bool IsNull () const
 Returns true if the object has not been initialized yet.
 
 operator bool () const
 Returns true if the object is not null. More...
 
bool IsEqual (const ModelData_Shape &theOther) const
 Returns true if the shape shares the same geometry and subshape graph, and has equal orientation. More...
 
bool IsSame (const ModelData_Shape &theOther) const
 Returns true if the shape shares the same geometry and subshape graph. More...
 
internal::ModelData_ShapeImpl * Impl () const
 Returns internal implementation object.
 

Static Public Member Functions

static ModelData_Body Create (const ModelData_Shape &theShape)
 Creates a body from an arbitrary shape. More...
 
static const ModelData_BodyCast (const ModelData_Shape &theShape)
 
static ModelData_BodyCast (ModelData_Shape &theShape)
 

Additional Inherited Members

- Protected Member Functions inherited from cadex::ModelData_Shape
 ModelData_Shape (const TopoDS_Shape &theOther, bool)
 Constructor.
 
 ModelData_Shape (internal::ModelData_ShapeImpl *theImpl)
 Constructor.
 
- Protected Attributes inherited from cadex::ModelData_Shape
internal::Base_Handle myImpl
 Internal implementation object.
 

Detailed Description

Defines a root topological shape that can be owned by B-Rep representation.

Body types

CAD Exchanger supports body types (defined by the ModelData_BodyType enumeration) defined in the following table:

bodysolid_256.png
Solid body
solid - contains a single solid
bodysheet_256.png
Sheet body
sheet - contains a single face or a single shell or a flat group of face(s) and/or shell(s)
bodywireframe_256.png
Wireframe body
wireframe - contains a single edge or a single wire or a flat group of edge(s) and/or wire(s)
bodyacorn_256.png
Acorn body
acorn - contains a single vertex

The body type is returned by BodyType().

Depending on its type, a body can hold either:

Thus, this definition is close to Parasolid definition, except that Parasolid allows to have multiple solids in a solid body. CAD Exchanger does not allow this.

Creation

A body can is created with the help of the static Create() method from any arbitrary topological shape (ModelData_Shape). A solid that allows multiple shapes (e.g. sheet body can contain several faces and/or shells) can be expanded with the Append() method.

Children can be retrived using ModelData_Shape::Iterator.

Examples:
meshing/main.cxx, and modelexplorer/main.cxx.

Member Function Documentation

◆ Append()

bool cadex::ModelData_Body::Append ( const ModelData_Shape theShape)

Adds a shape to the body.

Returns true if the shape has been successfully added and false otherwise. Result depends upon the existing body contents and the shape being added. The check are applied in the following order:

  • if theShape is null returns false;
  • if the body is null then initializes it depending on the shape type (see also Create()) and returns true;
  • if the body is either solid or acorn then returns false;
  • if theShape is simple (i.e. from vertex to solid) and the body is either wireframe or sheet then either appends the shape and returns true (if the types of the shape and body are compatible) or returns false (if the types are incompatible).
  • if theShape is a body of the same type as this body then adds its components. Returns true, and returns false if the types are incompatible.
  • if theShape is a body list then tries to add its bodies using the above approach. Returns true if at least one body succeeded.

◆ BodyType()

ModelData_BodyType cadex::ModelData_Body::BodyType ( ) const

Returns a body type.

See also
ModelData_BodyType.
Examples:
meshing/main.cxx, and modelexplorer/main.cxx.

◆ Create()

ModelData_Body cadex::ModelData_Body::Create ( const ModelData_Shape theShape)
static

Creates a body from an arbitrary shape.

If theShape is already a body then just returns it. If theShape is a body list then returns its first body or empty, if the list is empty. Otherwise creates a body wrapping theShape.