Hide menu
Loading...
Searching...
No Matches
cadex::ModelAlgo_BRepMesher Class Reference

Computes a polygonal representation from a B-Rep one. More...

Public Types

typedef ModelAlgo_BRepMesherParameters ParametersType
 Defines a mesher parameters type.
 

Public Member Functions

 ModelAlgo_BRepMesher ()
 Constructor.
 
 ModelAlgo_BRepMesher (const ModelAlgo_BRepMesherParameters &theParameters)
 Constructor.
 
const ModelAlgo_BRepMesherParametersParameters () const
 Returns parameters.
 
ModelAlgo_BRepMesherParametersParameters ()
 Returns parameters.
 
void Compute (const ModelData_Model &theModel, bool theEnforceAddition=false) const
 Computes polygonal representations for all parts in the model.
 
void Compute (const ModelData_SceneGraphElement &theElement, bool theEnforceAddition=false) const
 Computes polygonal representations for all parts under the graph element.
 
ModelData_PolyRepresentation Compute (const ModelData_BRepRepresentation &theBRep, bool theComputeImmediately=true) const
 Computes polygonal representation for a B-Rep representation.
 
ModelData_PolyShapeList Compute (const ModelData_Body &theBody) const
 Computes polygonal representation for a B-Rep body.
 
ModelData_PolyShapeList Compute (const ModelData_Body &theBody, const ModelData_BRepRepresentation &theContext) const
 Computes polygonal representation for a B-Rep body.
 
ModelData_PolyShapeList Compute (const ModelData_Body &theBody, std::shared_ptr< Mesh_SMDS > &theMeshDS) const
 Computes polygonal representation for a B-Rep body.
 
ModelData_PolyShapeList Compute (const ModelData_Body &theBody, const ModelData_BRepRepresentation &theContext, std::shared_ptr< Mesh_SMDS > &theMeshDS) const
 Computes polygonal representation for a B-Rep body.
 
const ModelData_BRepToPolyAssociationsBRepToPolyAssociations () const
 Returns ModelData_BRepToPolyAssociations object which contain associations between shapes and meshes.
 
Base_ProgressStatusProgressStatus () const
 Returns a progress status.
 
const std::shared_ptr< internal::ModelAlgo_BRepMesherImpl > & Impl () const
 Returns an implementation object.
 

Protected Attributes

std::shared_ptr< internal::ModelAlgo_BRepMesherImpl > myImpl
 Internal implementation object.
 

Detailed Description

Computes a polygonal representation from a B-Rep one.

A mesher can operate on an entire model, a subtree of a scene graph element, or a particular B-Rep body.

The mesher can generate either a visualization or a computational mesh depending on parameters specified in the ModelAlgo_BRepMesherParameters object set with the Parameters() method. By default, only a visualization mesh is generated.

The following examples demonstrate typical scenarios of using a mesher.

Example 1 - generation of polygonal representations using the visualization mesher for all the parts with B-Rep representation which do not have polygonal representation:

ModelData_Model aModel = ...;
aMesher.Compute (aModel);
Computes a polygonal representation from a B-Rep one.
Definition: ModelAlgo_BRepMesher.hxx:48
void Compute(const ModelData_Model &theModel, bool theEnforceAddition=false) const
Computes polygonal representations for all parts in the model.
Definition: ModelAlgo_BRepMesher.cxx:478
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:43

Example 2 - generation of a computational mesh for a particular body:

aParam.ComputationalMeshAlgo() = aFactory;
ModelData_Part aPart = ...;
if (aBRep) {
const ModelData_BodyList& aList = aBRep.Get();
for (size_t i = 0; i < aList.Size(); ++i) {
const ModelData_Body& aBody = aList[i];
ModelAlgo_BRepMesher aMesher (aParam);
ModelData_PolyShapeList aPolyList = aMesher.Compute (aBody);
//explore aPolyList...
}
}
Creates a meshing algorithm based on the Netgen library.
Definition: MeshAlgo_NetgenFactory.hxx:28
Defines parameters used by the B-Rep mesher.
Definition: ModelAlgo_BRepMesherParameters.hxx:33
Defines precise Boundary Representation of part.
Definition: ModelData_BRepRepresentation.hxx:39
const ModelData_BodyList & Get() const
Returns an associated topological object.
Definition: ModelData_BRepRepresentation.cxx:626
Defines a root topological shape that can be owned by B-Rep representation.
Definition: ModelData_Body.hxx:28
Defines a list of bodies.
Definition: ModelData_BodyList.hxx:31
Defines a leaf node in the scene graph hiearchy.
Definition: ModelData_Part.hxx:35
ModelData_BRepRepresentation BRepRepresentation() const
Definition: ModelData_Part.cxx:360
List of vertex sets contained in polygonal representation.
Definition: ModelData_PolyShapeList.hxx:33
See also
The B-Rep mesher, Visualization mesher, Computational meshers.
Examples
MTKConverter/Program.cs, MTKConverter/main.cxx, exploring/polyrepresentation/Program.cs, exploring/polyrepresentation/main.cxx, meshing/lods/Program.cs, meshing/lods/main.cxx, meshing/mefisto/Program.cs, meshing/mefisto/main.cxx, meshing/netgen/Program.cs, meshing/netgen/main.cxx, meshing/remeshing/Program.cs, meshing/remeshing/main.cxx, meshing/visualizationmesher/Program.cs, meshing/visualizationmesher/main.cxx, misc/progressindicator/Program.cs, misc/progressindicator/main.cxx, misc/progressindicatorgui/main.cxx, wall_thickness/visualization/Program.cs, and wall_thickness/visualization/main.cxx.

Constructor & Destructor Documentation

◆ ModelAlgo_BRepMesher() [1/2]

cadex::ModelAlgo_BRepMesher::ModelAlgo_BRepMesher ( )

Constructor.

Creates a visualization mesher with default parameters.

See also
ModelAlgo_BRepMesherParameters.

◆ ModelAlgo_BRepMesher() [2/2]

cadex::ModelAlgo_BRepMesher::ModelAlgo_BRepMesher ( const ModelAlgo_BRepMesherParameters theParameters)

Constructor.

Creates a mesher with specified parameters.

See also
Parameters().

Member Function Documentation

◆ BRepToPolyAssociations()

const ModelData_BRepToPolyAssociations & cadex::ModelAlgo_BRepMesher::BRepToPolyAssociations ( ) const

Returns ModelData_BRepToPolyAssociations object which contain associations between shapes and meshes.

If SaveBRepToPolyAssociations() parameter is set to true, then returns filled ModelData_BRepToPolyAssociations. Otherwise it will be empty.

Note
BRepToPolyAssociations API is currently in preview. To use it in C++ one must define the preprocessor macro __CADEX_PREVIEW_B_REP_TO_POLY_ASSOCIATIONS to 1. As the API changes to accommodate the needs of users compatibility will be preserved as much as possible but is ultimately not guaranteed.
Examples
meshing/visualizationmesher/Program.cs.

◆ Compute() [1/7]

ModelData_PolyShapeList cadex::ModelAlgo_BRepMesher::Compute ( const ModelData_Body theBody) const

Computes polygonal representation for a B-Rep body.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns a created list of vertex set.

Unlike the overloaded Compute() accepting ModelData_BRepRepresentation context this one only generates mesh geometry without colors and other attributes.

◆ Compute() [2/7]

ModelData_PolyShapeList cadex::ModelAlgo_BRepMesher::Compute ( const ModelData_Body theBody,
const ModelData_BRepRepresentation theContext 
) const

Computes polygonal representation for a B-Rep body.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

theContext specifies a B-Rep representation the body belongs to. This context information can be used to generate color and other attribute information registered in the context.

Returns a created list of vertex set.

◆ Compute() [3/7]

ModelData_PolyShapeList cadex::ModelAlgo_BRepMesher::Compute ( const ModelData_Body theBody,
const ModelData_BRepRepresentation theBRep,
std::shared_ptr< Mesh_SMDS > &  theMeshDS 
) const

Computes polygonal representation for a B-Rep body.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This method should only be used when using a computational mesher and when the opaque object theMeshDS is used to further access Netgen-specific extensions.

theContext specifies a B-Rep representation the body belongs to. This context information can be used to generate color and other attribute information registered in the context.

Returns a created list of vertex set.

◆ Compute() [4/7]

ModelData_PolyShapeList cadex::ModelAlgo_BRepMesher::Compute ( const ModelData_Body theBody,
std::shared_ptr< Mesh_SMDS > &  theMeshDS 
) const

Computes polygonal representation for a B-Rep body.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

theContext specifies a B-Rep representation the body belongs to. This context information can be used to generate color and other attribute information registered in the context.

This method should only be used when using a computational mesher and when the opaque object theMeshDS is used to further access Netgen-specific extensions.

Returns a created list of vertex set.

◆ Compute() [5/7]

ModelData_PolyRepresentation cadex::ModelAlgo_BRepMesher::Compute ( const ModelData_BRepRepresentation theBRep,
bool  theComputeImmediately = true 
) const

Computes polygonal representation for a B-Rep representation.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns an object of ModelData_PolyRepresentation created with theBRep, Parameters() and theComputeImmediately. The method provided only for convenience.

See also
ModelData_PolyRepresentation constructor.

◆ Compute() [6/7]

void cadex::ModelAlgo_BRepMesher::Compute ( const ModelData_Model theModel,
bool  theEnforceAddition = false 
) const

Computes polygonal representations for all parts in the model.

If a part has a B-Rep representation but does not have a polygonal one or if theEnforceAddition is true then the computed polygonal representation will be added to the part (via ModelData_BRepTriangulationProvider).

If theEnforceAddition is false and the part already has a polygonal representation then the part will be skipped.

Examples
MTKConverter/Program.cs, MTKConverter/main.cxx, exploring/polyrepresentation/Program.cs, meshing/lods/Program.cs, meshing/mefisto/Program.cs, meshing/mefisto/main.cxx, meshing/netgen/Program.cs, meshing/netgen/main.cxx, meshing/remeshing/Program.cs, meshing/remeshing/main.cxx, meshing/visualizationmesher/Program.cs, misc/progressindicator/Program.cs, misc/progressindicator/main.cxx, misc/progressindicatorgui/main.cxx, and wall_thickness/visualization/main.cxx.

◆ Compute() [7/7]

void cadex::ModelAlgo_BRepMesher::Compute ( const ModelData_SceneGraphElement theElement,
bool  theEnforceAddition = false 
) const

Computes polygonal representations for all parts under the graph element.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

If a part has a B-Rep representation but does not have a polygonal one or if theEnforceAddition is true then the computed polygonal representation will be added to the part (via ModelData_BRepTriangulationProvider).

If theEnforceAddition is false and the part already has a polygonal representation then the part will be skipped.