Hide menu
Loading...
Searching...
No Matches

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

#include <cadex/ModelData_Body.hxx>

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

Public Member Functions

ModelData_BodyType BodyType () const
 Returns a body type.
 
bool Append (const ModelData_Shape &theShape)
 Adds a shape to the body.
 
- 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.
 
ModelData_ShapeType Type () const
 Returns a shape type.
 
ModelData_ShapeOrientation Orientation () const
 Returns orientation flag.
 
ModelData_Shape Reversed () const
 Returns a shape that shares the same geometry and subshape graph but has opposite orientation.
 
ModelData_Shape Oriented (ModelData_ShapeOrientation theOrientation) const
 Returns a shape that shares the same geometry and subshape graph and has specified orientation.
 
void Nullify ()
 Nullifies the object.
 
bool IsNull () const
 Returns true if the object has not been initialized yet.
 
 operator bool () const
 Returns true if the object is not null.
 
bool IsEqual (const ModelData_Shape &theOther) const
 Returns true if the shape shares the same geometry and subshape graph, and has equal orientation.
 
bool IsSame (const ModelData_Shape &theOther) const
 Returns true if the shape shares the same geometry and subshape graph.
 
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.
 
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:

Solid body
solid - contains a single solid
Sheet body
sheet - contains a single face or a single shell or a flat group of face(s) and/or shell(s)
Wireframe body
wireframe - contains a single edge or a single wire or a flat group of edge(s) and/or wire(s)
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
MTKConverter/Program.cs, advgeom/brepsimplify/Program.cs, advgeom/brepsimplify/main.cxx, exploring/brepgeometry/Program.cs, exploring/brepgeometry/main.cxx, exploring/breprepresentation/Program.cs, exploring/breprepresentation/main.cxx, exploring/layers/Program.cs, exploring/layers/main.cxx, exploring/propertytable/Program.cs, helpers/shape_processor.cs, machining/dfm_analyzer/Program.cs, machining/feature_recognizer/Program.cs, meshing/lods/Program.cs, meshing/lods/main.cxx, meshing/visualizationmesher/Program.cs, modeling/brep/Program.cs, modeling/brep/main.cxx, sheet_metal/dfm_analyzer/Program.cs, sheet_metal/feature_recognizer/Program.cs, sheet_metal/unfolder/Program.cs, and wall_thickness/visualization/Program.cs.

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()

◆ 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.

Examples
meshing/lods/Program.cs, modeling/brep/Program.cs, and wall_thickness/visualization/Program.cs.