SHAPER  9.12.0
GeomAlgoAPI_Prism Class Reference

Allows to create the prism based on a given face and bounding planes. More...

Inheritance diagram for GeomAlgoAPI_Prism:
Inheritance graph

Public Types

enum  BuilderType { Unknown , OCCT_BRepBuilderAPI_MakeShape , OCCT_BOPAlgo_Builder }
 Builder type enum. More...
 

Public Member Functions

GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism (const GeomShapePtr theBaseShape, const std::shared_ptr< GeomAPI_Dir > theDirection, const GeomShapePtr theToShape, const double theToSize, const GeomShapePtr theFromShape, const double theFromSize)
 Creates extrusion for the given shape along the normal for this shape. More...
 
GEOMALGOAPI_EXPORT const ListOfShape & fromShapes () const
 
GEOMALGOAPI_EXPORT const ListOfShape & toShapes () const
 
GEOMALGOAPI_EXPORT void addFromShape (const std::shared_ptr< GeomAPI_Shape > theShape)
 Adds a shape to list of from shape. More...
 
GEOMALGOAPI_EXPORT void setFromShapes (const ListOfShape &theListOfShapes)
 Sets from shapes. More...
 
GEOMALGOAPI_EXPORT void addToShape (const std::shared_ptr< GeomAPI_Shape > theShape)
 Adds a face to list of to shape. More...
 
GEOMALGOAPI_EXPORT void setToShapes (const ListOfShape &theListOfShapes)
 Sets to shapes. More...
 
GEOMALGOAPI_EXPORT void init (const ListOfMakeShape &theMakeShapeList)
 Initializes a class with new list of algorithms. More...
 
GEOMALGOAPI_EXPORT const ListOfMakeShape & list () const
 
GEOMALGOAPI_EXPORT void appendAlgo (const GeomMakeShapePtr theMakeShape)
 Adds algo to the end of list. More...
 
virtual GEOMALGOAPI_EXPORT const GeomShapePtr shape () const
 
virtual GEOMALGOAPI_EXPORT void generated (const GeomShapePtr theShape, ListOfShape &theHistory)
 
virtual GEOMALGOAPI_EXPORT void modified (const GeomShapePtr theShape, ListOfShape &theHistory)
 
virtual GEOMALGOAPI_EXPORT bool isDeleted (const GeomShapePtr theShape)
 
template<class T >
void initialize (T *theBuilder, const BuilderType theBuilderType=OCCT_BRepBuilderAPI_MakeShape)
 Initializes internals. More...
 
virtual GEOMALGOAPI_EXPORT void build ()
 Execute the algorithm. More...
 
GEOMALGOAPI_EXPORT bool isDone () const
 
GEOMALGOAPI_EXPORT bool isValid () const
 
GEOMALGOAPI_EXPORT std::shared_ptr< GeomAPI_DataMapOfShapeShapemapOfSubShapes () const
 
virtual GEOMALGOAPI_EXPORT bool check ()
 
virtual GEOMALGOAPI_EXPORT void prepareNamingFaces ()
 Prepare the naming of faces. More...
 
GEOMALGOAPI_EXPORT std::map< std::string, GeomShapePtr > getCreatedFaces ()
 
GEOMALGOAPI_EXPORT std::string getError ()
 
GEOMALGOAPI_EXPORT bool checkValid (std::string theMessage)
 Check the validity of the produced shape. More...
 
GEOMALGOAPI_EXPORT bool isNewShapesCollected (GeomShapePtr theWholeOld, const int theShapeType)
 Optimization of access the new shapes by old shapes for the limited set of needed new shapes. More...
 
GEOMALGOAPI_EXPORT void collectNewShapes (GeomShapePtr theWholeOld, const int theShapeType)
 Optimization of access the new shapes by old shapes for the limited set of needed new shapes. More...
 
GEOMALGOAPI_EXPORT GeomShapePtr oldShapesForNew (GeomShapePtr theWholeOld, GeomShapePtr theNewShape, const int theShapeType)
 Optimization of access the new shapes by old shapes for the limited set of needed new shapes. More...
 
GEOMALGOAPI_EXPORT void fixOrientation (GeomShapePtr &theShape)
 Replaces theShape with shape from myMap. More...
 
template<class T >
T * implPtr ()
 Returns the pointer to the impl. More...
 
template<class T >
const T * implPtr () const
 Returns the pointer to the impl. More...
 
template<class T >
const T & impl () const
 Returns the reference object of the impl. More...
 
template<class T >
void setImpl (T *theImpl)
 Updates the impl (deletes the old one) More...
 
GEOMAPI_EXPORT bool empty () const
 Returns true if the impl is empty. More...
 

Protected Member Functions

GEOMALGOAPI_EXPORT void setBuilderType (const BuilderType theBuilderType)
 Sets builder type. More...
 
GEOMALGOAPI_EXPORT void setDone (const bool theFlag)
 Sets status of builder. More...
 
GEOMALGOAPI_EXPORT void setShape (const GeomShapePtr theShape)
 Sets result shape. More...
 
bool isValidForHistory (const GeomShapePtr theShape)
 

Protected Attributes

ListOfMakeShape myListOfMakeShape
 List of make shape algos. More...
 
std::shared_ptr< GeomAPI_DataMapOfShapeShapemyMap
 Data map to keep correct orientation of sub-shapes. More...
 
std::string myError
 Error occurred during the execution of an algorithm. More...
 
std::map< std::string, GeomShapePtr > myCreatedFaces
 Map of created faces with their name for naming. More...
 

Detailed Description

Allows to create the prism based on a given face and bounding planes.


Note that only planar faces are allowed as bounding faces and resulting extrusion will be bounded by the infinite planes taken from the faces.

Member Enumeration Documentation

◆ BuilderType

Builder type enum.

Constructor & Destructor Documentation

◆ GeomAlgoAPI_Prism()

GeomAlgoAPI_Prism::GeomAlgoAPI_Prism ( const GeomShapePtr  theBaseShape,
const std::shared_ptr< GeomAPI_Dir theDirection,
const GeomShapePtr  theToShape,
const double  theToSize,
const GeomShapePtr  theFromShape,
const double  theFromSize 
)

Creates extrusion for the given shape along the normal for this shape.

Parameters
[in]theBaseShapeplanar face or wire to be extruded.
[in]theDirectiondirection of extrusion. Can be empty if theBaseShape is planar wire or face.
[in]theToShapetop bounding shape. Can be empty. In this case offset will be applied to the basis.
[in]theToSizeoffset for "to" plane.
[in]theFromShapebottom bounding shape. Can be empty. In this case offset will be applied to the basis.
[in]theFromSizeoffset for "from" plane.

Member Function Documentation

◆ fromShapes()

const ListOfShape & GeomAlgoAPI_MakeSweep::fromShapes ( ) const
inherited
Returns
the list of from shapes.

◆ toShapes()

const ListOfShape & GeomAlgoAPI_MakeSweep::toShapes ( ) const
inherited
Returns
the list of to shapes.

◆ addFromShape()

void GeomAlgoAPI_MakeSweep::addFromShape ( const std::shared_ptr< GeomAPI_Shape theShape)
inherited

Adds a shape to list of from shape.

Parameters
[in]theShapea shape to add.

◆ setFromShapes()

void GeomAlgoAPI_MakeSweep::setFromShapes ( const ListOfShape &  theListOfShapes)
inherited

Sets from shapes.

Parameters
[in]theListOfShapeslist of from shapes.

◆ addToShape()

void GeomAlgoAPI_MakeSweep::addToShape ( const std::shared_ptr< GeomAPI_Shape theShape)
inherited

Adds a face to list of to shape.

Parameters
[in]theShapea face to add.

◆ setToShapes()

void GeomAlgoAPI_MakeSweep::setToShapes ( const ListOfShape &  theListOfShapes)
inherited

Sets to shapes.

Parameters
[in]theListOfShapeslist of to shapes.

◆ init()

void GeomAlgoAPI_MakeShapeList::init ( const ListOfMakeShape &  theMakeShapeList)
inherited

Initializes a class with new list of algorithms.

Parameters
[in]theMakeShapeListlist of algorithms.

◆ list()

const ListOfMakeShape & GeomAlgoAPI_MakeShapeList::list ( ) const
inherited
Returns
the list reference

◆ appendAlgo()

void GeomAlgoAPI_MakeShapeList::appendAlgo ( const GeomMakeShapePtr  theMakeShape)
inherited

Adds algo to the end of list.

Parameters
[in]theMakeShapealgo to be added.

◆ shape()

const GeomShapePtr GeomAlgoAPI_MakeShapeList::shape ( ) const
virtualinherited
Returns
a shape built by the shape construction algorithms

Reimplemented from GeomAlgoAPI_MakeShape.

◆ generated()

void GeomAlgoAPI_MakeShapeList::generated ( const GeomShapePtr  theShape,
ListOfShape &  theHistory 
)
virtualinherited
Returns
the list of shapes generated from the shape theShape

Reimplemented from GeomAlgoAPI_MakeShape.

Reimplemented in GeomAlgoAPI_Pipe, and GeomAlgoAPI_MakeShapeSet.

◆ modified()

void GeomAlgoAPI_MakeShapeList::modified ( const GeomShapePtr  theShape,
ListOfShape &  theHistory 
)
virtualinherited
Returns
the list of shapes modified from the shape theShape

Reimplemented from GeomAlgoAPI_MakeShape.

Reimplemented in GeomAlgoAPI_MakeShapeSet.

◆ isDeleted()

bool GeomAlgoAPI_MakeShapeList::isDeleted ( const GeomShapePtr  theShape)
virtualinherited
Returns
whether the shape is deleted

Reimplemented from GeomAlgoAPI_MakeShape.

◆ initialize()

template<class T >
void GeomAlgoAPI_MakeShape::initialize ( T *  theBuilder,
const BuilderType  theBuilderType = OCCT_BRepBuilderAPI_MakeShape 
)
inlineinherited

Initializes internals.

Parameters
[in]theBuilderpointer to the builder.
[in]theBuilderTypebuilder type.

◆ build()

virtual GEOMALGOAPI_EXPORT void GeomAlgoAPI_MakeShape::build ( )
inlinevirtualinherited

◆ isDone()

bool GeomAlgoAPI_MakeShape::isDone ( ) const
inherited
Returns
status of builder.

◆ isValid()

bool GeomAlgoAPI_MakeShape::isValid ( ) const
inherited
Returns
true if resulting shape is valid.

◆ mapOfSubShapes()

std::shared_ptr< GeomAPI_DataMapOfShapeShape > GeomAlgoAPI_MakeShape::mapOfSubShapes ( ) const
inherited
Returns
map of sub-shapes of the result. To be used for History keeping.

◆ check()

virtual GEOMALGOAPI_EXPORT bool GeomAlgoAPI_MakeShape::check ( )
inlinevirtualinherited

◆ prepareNamingFaces()

void GeomAlgoAPI_MakeShape::prepareNamingFaces ( )
virtualinherited

Prepare the naming of faces.

Reimplemented in GeomAlgoAPI_Box.

◆ getCreatedFaces()

GEOMALGOAPI_EXPORT std::map< std::string, GeomShapePtr > GeomAlgoAPI_MakeShape::getCreatedFaces ( )
inlineinherited
Returns
the list of created faces.

◆ getError()

GEOMALGOAPI_EXPORT std::string GeomAlgoAPI_MakeShape::getError ( )
inlineinherited
Returns
the error.

◆ checkValid()

bool GeomAlgoAPI_MakeShape::checkValid ( std::string  theMessage)
inherited

Check the validity of the produced shape.

◆ isNewShapesCollected()

bool GeomAlgoAPI_MakeShape::isNewShapesCollected ( GeomShapePtr  theWholeOld,
const int  theShapeType 
)
inherited

Optimization of access the new shapes by old shapes for the limited set of needed new shapes.

Parameters
theWholeOldthe whole old shape
theShapeTypetype of the sub-shapes that is used for optimization
Returns
true if optimization containers are already filled

◆ collectNewShapes()

void GeomAlgoAPI_MakeShape::collectNewShapes ( GeomShapePtr  theWholeOld,
const int  theShapeType 
)
inherited

Optimization of access the new shapes by old shapes for the limited set of needed new shapes.

Parameters
theWholeOldthe whole old shape
theShapeTypetype of the sub-shapes that is used for optimization
Returns
true if optimization containers are already filled

◆ oldShapesForNew()

GeomShapePtr GeomAlgoAPI_MakeShape::oldShapesForNew ( GeomShapePtr  theWholeOld,
GeomShapePtr  theNewShape,
const int  theShapeType 
)
inherited

Optimization of access the new shapes by old shapes for the limited set of needed new shapes.

Parameters
theWholeOldthe whole old shape
theNewShapethe whole new shape
theShapeTypetype of the old sub-shapes
Returns
compound of all old shapes that were used for creation of the given new

◆ fixOrientation()

void GeomAlgoAPI_MakeShape::fixOrientation ( GeomShapePtr &  theShape)
inherited

Replaces theShape with shape from myMap.

◆ setBuilderType()

void GeomAlgoAPI_MakeShape::setBuilderType ( const BuilderType  theBuilderType)
protectedinherited

Sets builder type.

Parameters
[in]theBuilderTypenew builder type.

◆ setDone()

void GeomAlgoAPI_MakeShape::setDone ( const bool  theFlag)
protectedinherited

Sets status of builder.

Parameters
[in]theFlagnew status.

◆ setShape()

void GeomAlgoAPI_MakeShape::setShape ( const GeomShapePtr  theShape)
protectedinherited

Sets result shape.

Parameters
[in]theShapenew shape.

◆ isValidForHistory()

bool GeomAlgoAPI_MakeShape::isValidForHistory ( const GeomShapePtr  theShape)
protectedinherited
Returns
true if passed shape is valid for history.

◆ implPtr() [1/2]

template<class T >
T* GeomAPI_Interface::implPtr ( )
inlineinherited

Returns the pointer to the impl.

◆ implPtr() [2/2]

template<class T >
const T* GeomAPI_Interface::implPtr ( ) const
inlineinherited

Returns the pointer to the impl.

◆ impl()

template<class T >
const T& GeomAPI_Interface::impl ( ) const
inlineinherited

Returns the reference object of the impl.

◆ setImpl()

template<class T >
void GeomAPI_Interface::setImpl ( T *  theImpl)
inlineinherited

Updates the impl (deletes the old one)

◆ empty()

bool GeomAPI_Interface::empty ( ) const
inherited

Returns true if the impl is empty.

Field Documentation

◆ myListOfMakeShape

ListOfMakeShape GeomAlgoAPI_MakeShapeList::myListOfMakeShape
protectedinherited

List of make shape algos.

◆ myMap

std::shared_ptr<GeomAPI_DataMapOfShapeShape> GeomAlgoAPI_MakeShape::myMap
protectedinherited

Data map to keep correct orientation of sub-shapes.

◆ myError

std::string GeomAlgoAPI_MakeShape::myError
protectedinherited

Error occurred during the execution of an algorithm.

◆ myCreatedFaces

std::map< std::string, GeomShapePtr > GeomAlgoAPI_MakeShape::myCreatedFaces
protectedinherited

Map of created faces with their name for naming.