The representation for a CAD Shape. More...
#include <TopoShape.h>
Public Member Functions | |
const TopoDS_Shape & | getShape () const |
void | operator= (const TopoShape &) |
void | setShape (const TopoDS_Shape &shape) |
TopoShape () | |
TopoShape (const TopoDS_Shape &) | |
TopoShape (const TopoShape &) | |
~TopoShape () | |
Subelement management | |
virtual std::vector< const char * > | getElementTypes (void) const |
Sub type list List of different subelement types it is NOT a list of the subelements itself. More... | |
virtual unsigned long | countSubElements (const char *Type) const |
virtual Data::Segment * | getSubElement (const char *Type, unsigned long) const |
get the subelement by type and number More... | |
virtual void | getLinesFromSubElement (const Data::Segment *, std::vector< Base::Vector3d > &Points, std::vector< Line > &lines) const |
Get lines from segment. More... | |
virtual void | getFacesFromSubElement (const Data::Segment *, std::vector< Base::Vector3d > &Points, std::vector< Base::Vector3d > &PointNormals, std::vector< Facet > &faces) const |
Get faces from segment. More... | |
TopoDS_Shape | getSubShape (const char *Type, bool silent=false) const |
get the Topo"sub"Shape with the given name More... | |
TopoDS_Shape | getSubShape (TopAbs_ShapeEnum type, int idx, bool silent=false) const |
std::vector< TopoShape > | getSubTopoShapes (TopAbs_ShapeEnum type=TopAbs_SHAPE) const |
std::vector< TopoDS_Shape > | getSubShapes (TopAbs_ShapeEnum type=TopAbs_SHAPE) const |
unsigned long | countSubShapes (const char *Type) const |
unsigned long | countSubShapes (TopAbs_ShapeEnum type) const |
bool | hasSubShape (const char *Type) const |
bool | hasSubShape (TopAbs_ShapeEnum type) const |
PyObject * | getPySubShape (const char *Type, bool silent=false) const |
get the Topo"sub"Shape with the given name More... | |
PyObject * | getPyObject () |
This method returns the Python wrapper for a C++ object. More... | |
void | setPyObject (PyObject *) |
Save/restore | |
void | Save (Base::Writer &writer) const |
This method is used to save properties to an XML document. More... | |
void | Restore (Base::XMLReader &reader) |
This method is used to restore properties from an XML document. More... | |
void | SaveDocFile (Base::Writer &writer) const |
This method is used to save large amounts of data to a binary file. More... | |
void | RestoreDocFile (Base::Reader &reader) |
This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More... | |
unsigned int | getMemSize (void) const |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More... | |
Input/Output | |
void | read (const char *FileName) |
void | write (const char *FileName) const |
void | dump (std::ostream &out) const |
void | importIges (const char *FileName) |
void | importStep (const char *FileName) |
void | importBrep (const char *FileName) |
void | importBrep (std::istream &, int indicator=1) |
void | importBinary (std::istream &) |
void | exportIges (const char *FileName) const |
void | exportStep (const char *FileName) const |
void | exportBrep (const char *FileName) const |
void | exportBrep (std::ostream &) const |
void | exportBinary (std::ostream &) |
void | exportStl (const char *FileName, double deflection) const |
void | exportFaceSet (double, double, const std::vector< App::Color > &, std::ostream &) const |
void | exportLineSet (std::ostream &) const |
Query | |
bool | isNull () const |
bool | isValid () const |
bool | analyze (bool runBopCheck, std::ostream &) const |
bool | isClosed () const |
bool | isCoplanar (const TopoShape &other, double tol=-1) const |
bool | findPlane (gp_Pln &pln, double tol=-1) const |
bool | isInfinite () const |
Returns true if the expansion of the shape is infinite, false otherwise. More... | |
Boolean operation | |
TopoDS_Shape | cut (TopoDS_Shape) const |
TopoDS_Shape | cut (const std::vector< TopoDS_Shape > &, Standard_Real tolerance=0.0) const |
TopoDS_Shape | common (TopoDS_Shape) const |
TopoDS_Shape | common (const std::vector< TopoDS_Shape > &, Standard_Real tolerance=0.0) const |
TopoDS_Shape | fuse (TopoDS_Shape) const |
TopoDS_Shape | fuse (const std::vector< TopoDS_Shape > &, Standard_Real tolerance=0.0) const |
TopoDS_Shape | oldFuse (TopoDS_Shape) const |
TopoDS_Shape | section (TopoDS_Shape, Standard_Boolean approximate=Standard_False) const |
TopoDS_Shape | section (const std::vector< TopoDS_Shape > &, Standard_Real tolerance=0.0, Standard_Boolean approximate=Standard_False) const |
std::list< TopoDS_Wire > | slice (const Base::Vector3d &, double) const |
TopoDS_Compound | slices (const Base::Vector3d &, const std::vector< double > &) const |
TopoDS_Shape | generalFuse (const std::vector< TopoDS_Shape > &sOthers, Standard_Real tolerance, std::vector< TopTools_ListOfShape > *mapInOut=nullptr) const |
generalFuse: run general fuse algorithm between this and shapes supplied as sOthers More... | |
TopoDS_Shape | makePipe (const TopoDS_Shape &profile) const |
Sweeping. More... | |
TopoDS_Shape | makePipeShell (const TopTools_ListOfShape &profiles, const Standard_Boolean make_solid, const Standard_Boolean isFrenet=Standard_False, int transition=0) const |
TopoDS_Shape | makePrism (const gp_Vec &) const |
TopoDS_Shape | revolve (const gp_Ax1 &, double d, Standard_Boolean isSolid=Standard_False) const |
revolve shape. Note: isSolid is deprecated (instead, use some Part::FaceMaker to make a face, first). More... | |
TopoDS_Shape | makeSweep (const TopoDS_Shape &profile, double, int) const |
TopoDS_Shape | makeTube (double radius, double tol, int cont, int maxdeg, int maxsegm) const |
TopoDS_Shape | makeTorus (Standard_Real radius1, Standard_Real radius2, Standard_Real angle1, Standard_Real angle2, Standard_Real angle3, Standard_Boolean isSolid=Standard_True) const |
TopoDS_Shape | makeHelix (Standard_Real pitch, Standard_Real height, Standard_Real radius, Standard_Real angle=0, Standard_Boolean left=Standard_False, Standard_Boolean style=Standard_False) const |
TopoDS_Shape | makeLongHelix (Standard_Real pitch, Standard_Real height, Standard_Real radius, Standard_Real angle=0, Standard_Boolean left=Standard_False) const |
TopoDS_Shape | makeSpiralHelix (Standard_Real radiusbottom, Standard_Real radiustop, Standard_Real height, Standard_Real nbturns=1, Standard_Real breakperiod=1, Standard_Boolean left=Standard_False) const |
TopoDS_Shape | makeThread (Standard_Real pitch, Standard_Real depth, Standard_Real height, Standard_Real radius) const |
TopoDS_Shape | makeLoft (const TopTools_ListOfShape &profiles, Standard_Boolean isSolid, Standard_Boolean isRuled, Standard_Boolean isClosed=Standard_False, Standard_Integer maxDegree=5) const |
TopoDS_Shape | makeOffsetShape (double offset, double tol, bool intersection=false, bool selfInter=false, short offsetMode=0, short join=0, bool fill=false) const |
TopoDS_Shape | makeOffset2D (double offset, short joinType=0, bool fill=false, bool allowOpenResult=false, bool intersection=false) const |
TopoDS_Shape | makeThickSolid (const TopTools_ListOfShape &remFace, double offset, double tol, bool intersection=false, bool selfInter=false, short offsetMode=0, short join=0) const |
Manipulation | |
void | transformGeometry (const Base::Matrix4D &rclMat) |
Applies a transformation on the real geometric data type. More... | |
TopoDS_Shape | transformGShape (const Base::Matrix4D &, bool copy=false) const |
bool | transformShape (const Base::Matrix4D &, bool copy, bool checkScale=false) |
TopoDS_Shape | mirror (const gp_Ax2 &) const |
TopoDS_Shape | toNurbs () const |
TopoDS_Shape | replaceShape (const std::vector< std::pair< TopoDS_Shape, TopoDS_Shape > > &s) const |
TopoDS_Shape | removeShape (const std::vector< TopoDS_Shape > &s) const |
void | sewShape (double tolerance=1.0e-06) |
bool | fix (double, double, double) |
bool | removeInternalWires (double) |
TopoDS_Shape | removeSplitter () const |
TopoDS_Shape | defeaturing (const std::vector< TopoDS_Shape > &s) const |
TopoDS_Shape | makeShell (const TopoDS_Shape &) const |
TopoShape::makeShell If the input shape is a compound with faces not being part of a shell it tries to make a shell. More... | |
Getting basic geometric entities | |
virtual void | getPoints (std::vector< Base::Vector3d > &Points, std::vector< Base::Vector3d > &Normals, float Accuracy, uint16_t flags=0) const |
Get points from object with given accuracy. More... | |
virtual void | getFaces (std::vector< Base::Vector3d > &Points, std::vector< Facet > &faces, float Accuracy, uint16_t flags=0) const |
Get faces from object with given accuracy. More... | |
void | setFaces (const std::vector< Base::Vector3d > &Points, const std::vector< Facet > &faces, double tolerance=1.0e-06) |
void | getDomains (std::vector< Domain > &) const |
Public Member Functions inherited from Data::ComplexGeoData | |
ComplexGeoData () | |
Constructor. More... | |
virtual | ~ComplexGeoData () |
Destructor. More... | |
virtual Segment * | getSubElementByName (const char *Name) const |
get subelement by combined name More... | |
void | applyTransform (const Base::Matrix4D &rclTrf) |
Applies an additional transformation to the current transformation. More... | |
void | applyTranslation (const Base::Vector3d &) |
Applies an additional translation to the current transformation. More... | |
void | applyRotation (const Base::Rotation &) |
Applies an additional rotation to the current transformation. More... | |
void | setPlacement (const Base::Placement &rclPlacement) |
Override the current transformation with a placement using the setTransform() method. More... | |
Base::Placement | getPlacement () const |
Return the current transformation as placement using getTransform(). More... | |
virtual Base::Vector3d | getPointFromLineIntersection (const Base::Vector3f &base, const Base::Vector3f &dir) const |
Get point from line object intersection More... | |
virtual void | getLines (std::vector< Base::Vector3d > &Points, std::vector< Line > &lines, float Accuracy, uint16_t flags=0) const |
Get lines from object with given accuracy. More... | |
Public Member Functions inherited from Base::Persistence | |
void | dumpToStream (std::ostream &stream, int compression) |
virtual unsigned int | getMemSize () const =0 |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More... | |
virtual Base::Type | getTypeId (void) const |
virtual void | Restore (XMLReader &)=0 |
This method is used to restore properties from an XML document. More... | |
virtual void | RestoreDocFile (Reader &) |
This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More... | |
void | restoreFromStream (std::istream &stream) |
virtual void | Save (Writer &) const =0 |
This method is used to save properties to an XML document. More... | |
virtual void | SaveDocFile (Writer &) const |
This method is used to save large amounts of data to a binary file. More... | |
Public Member Functions inherited from Base::BaseClass | |
BaseClass () | |
Construction. More... | |
BaseClass (const BaseClass &)=default | |
virtual PyObject * | getPyObject () |
This method returns the Python wrapper for a C++ object. More... | |
virtual Type | getTypeId () const |
bool | isDerivedFrom (const Type type) const |
BaseClass & | operator= (const BaseClass &)=default |
virtual void | setPyObject (PyObject *) |
virtual | ~BaseClass () |
Destruction. More... | |
Public Member Functions inherited from Base::Handled | |
int | getRefCount () const |
Handled () | |
const Handled & | operator= (const Handled &) |
void | ref () const |
void | unref () const |
virtual | ~Handled () |
Placement control | |
void | setTransform (const Base::Matrix4D &rclTrf) |
set the transformation of the CasCade Shape More... | |
void | setShapePlacement (const Base::Placement &rclTrf) |
set the transformation of the CasCade Shape More... | |
Base::Placement | getShapePlacement (void) const |
get the transformation of the CasCade Shape More... | |
Base::Matrix4D | getTransform (void) const |
get the transformation of the CasCade Shape More... | |
Base::BoundBox3d | getBoundBox (void) const |
Bound box from the CasCade shape. More... | |
virtual bool | getCenterOfGravity (Base::Vector3d ¢er) const |
Get the center of gravity If this method is implemented then true is returned and the center of gravity. More... | |
static void | convertTogpTrsf (const Base::Matrix4D &mtrx, gp_Trsf &trsf) |
static void | convertToMatrix (const gp_Trsf &trsf, Base::Matrix4D &mtrx) |
static Base::Matrix4D | convert (const gp_Trsf &trsf) |
static gp_Trsf | convert (const Base::Matrix4D &mtrx) |
Element name mapping aware shape maker | |
To be complete in next batch of patches | |
TopoShape & | makeCompound (const std::vector< TopoShape > &shapes, const char *op=nullptr, bool force=true) |
TopoShape & | makeWires (const TopoShape &shape, const char *op=nullptr, bool fix=false, double tol=0.0) |
TopoShape | makeWires (const char *op=nullptr, bool fix=false, double tol=0.0) const |
TopoShape & | makeFace (const std::vector< TopoShape > &shapes, const char *op=nullptr, const char *maker=nullptr) |
TopoShape & | makeFace (const TopoShape &shape, const char *op=nullptr, const char *maker=nullptr) |
TopoShape | makeFace (const char *op=nullptr, const char *maker=nullptr) const |
TopoShape & | makeTransform (const TopoShape &shape, const Base::Matrix4D &mat, const char *op=nullptr, bool checkScale=false, bool copy=false) |
TopoShape | makeTransform (const Base::Matrix4D &mat, const char *op=nullptr, bool checkScale=false, bool copy=false) const |
TopoShape & | makeTransform (const TopoShape &shape, const gp_Trsf &trsf, const char *op=nullptr, bool copy=false) |
TopoShape | makeTransform (const gp_Trsf &trsf, const char *op=nullptr, bool copy=false) const |
void | move (const TopLoc_Location &loc) |
TopoShape | moved (const TopLoc_Location &loc) const |
TopoShape & | makeGTransform (const TopoShape &shape, const Base::Matrix4D &mat, const char *op=nullptr, bool copy=false) |
TopoShape | makeGTransform (const Base::Matrix4D &mat, const char *op=nullptr, bool copy=false) const |
TopoShape & | makeRefine (const TopoShape &shape, const char *op=nullptr, bool no_fail=true) |
TopoShape | makeRefine (const char *op=nullptr, bool no_fail=true) const |
TopAbs_ShapeEnum | shapeType (bool silent=false) const |
const std::string & | shapeName (bool silent=false) const |
static TopAbs_ShapeEnum | shapeType (const char *type, bool silent=false) |
static TopAbs_ShapeEnum | shapeType (char type, bool silent=false) |
static const std::string & | shapeName (TopAbs_ShapeEnum type, bool silent=false) |
static std::pair< TopAbs_ShapeEnum, int > | shapeTypeAndIndex (const char *name) |
Additional Inherited Members | |
Static Public Member Functions inherited from Data::ComplexGeoData | |
static const std::string & | elementMapPrefix () |
Special prefix to mark the beginning of a mapped sub-element name. More... | |
static const std::string & | tagPostfix () |
Special postfix to mark the following tag. More... | |
static const std::string & | indexPostfix () |
Special postfix to mark the index of an array element. More... | |
static const std::string & | missingPrefix () |
Special prefix to mark a missing element. More... | |
static bool | hasMissingElement (const char *subname) |
Check if a subname contains missing element. More... | |
static const char * | isMappedElement (const char *name) |
Check if the name starts with elementMapPrefix() More... | |
static std::string | newElementName (const char *name) |
Strip out the trailing element name if there is mapped element name precedes it. More... | |
static std::string | oldElementName (const char *name) |
Strip out the mapped element name if there is one. More... | |
static std::string | noElementName (const char *name) |
Strip out the old and new element name if there is one. More... | |
static const char * | findElementName (const char *subname) |
Find the start of an element name in a subname. More... | |
static const char * | hasMappedElementName (const char *subname) |
Static Public Member Functions inherited from Base::Persistence | |
static void * | create (void) |
static std::string | encodeAttribute (const std::string &) |
Encodes an attribute upon saving. More... | |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Static Public Member Functions inherited from Base::BaseClass | |
static void * | create () |
static Type | getClassTypeId () |
static void | init () |
Public Attributes inherited from Data::ComplexGeoData | |
long | Tag |
Protected Member Functions inherited from Data::ComplexGeoData | |
Base::Vector3d | transformToOutside (const Base::Vector3f &vec) const |
from local to outside More... | |
Base::Vector3f | transformToInside (const Base::Vector3d &vec) const |
from local to inside More... | |
Static Protected Member Functions inherited from Base::BaseClass | |
static void | initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) |
The representation for a CAD Shape.
TopoShape::TopoShape | ( | ) |
Referenced by getFacesFromSubElement(), getPyObject(), makeOffset2D(), and transformShape().
TopoShape::TopoShape | ( | const TopoDS_Shape & | shape | ) |
TopoShape::TopoShape | ( | const TopoShape & | shape | ) |
References Data::ComplexGeoData::Tag.
TopoShape::~TopoShape | ( | ) |
References Part::buildBOPCheckResultVector(), and Part::buildShapeEnumVector().
TopoDS_Shape TopoShape::common | ( | const std::vector< TopoDS_Shape > & | shapes, |
Standard_Real | tolerance = 0.0 |
||
) | const |
References makeShell(), and draftutils.utils::tolerance().
TopoDS_Shape TopoShape::common | ( | TopoDS_Shape | shape | ) | const |
References makeShell().
|
static |
References convertTogpTrsf().
|
static |
References convertToMatrix().
|
static |
Referenced by convert(), and setTransform().
|
static |
Referenced by convert(), and getTransform().
|
virtual |
Implements Data::ComplexGeoData.
References countSubShapes().
Referenced by PartDesignGui::TaskDressUpParameters::addAllEdges(), PartDesign::Fillet::execute(), and PartDesign::Chamfer::execute().
unsigned long TopoShape::countSubShapes | ( | const char * | Type | ) | const |
References countSubShapes(), and shapeType().
Referenced by countSubElements(), countSubShapes(), PartDesign::DressUp::getAddSubShape(), and hasSubShape().
unsigned long TopoShape::countSubShapes | ( | TopAbs_ShapeEnum | type | ) | const |
TopoDS_Shape TopoShape::cut | ( | const std::vector< TopoDS_Shape > & | shapes, |
Standard_Real | tolerance = 0.0 |
||
) | const |
References makeShell(), and draftutils.utils::tolerance().
TopoDS_Shape TopoShape::cut | ( | TopoDS_Shape | shape | ) | const |
References makeShell().
Referenced by Surface::Cut::execute(), and PartDesign::DressUp::getAddSubShape().
TopoDS_Shape TopoShape::defeaturing | ( | const std::vector< TopoDS_Shape > & | s | ) | const |
void TopoShape::dump | ( | std::ostream & | out | ) | const |
void TopoShape::exportBinary | ( | std::ostream & | out | ) |
void TopoShape::exportBrep | ( | const char * | FileName | ) | const |
References Part::encodeFilename().
Referenced by write().
void TopoShape::exportBrep | ( | std::ostream & | out | ) | const |
void TopoShape::exportFaceSet | ( | double | dev, |
double | ca, | ||
const std::vector< App::Color > & | colors, | ||
std::ostream & | str | ||
) | const |
References Base::InventorBuilder::addIndexedFaceSet(), Base::InventorBuilder::addMaterial(), Base::InventorBuilder::addPoints(), Base::InventorBuilder::addShapeHints(), Base::InventorBuilder::beginPoints(), Base::InventorBuilder::beginSeparator(), Base::InventorBuilder::endPoints(), Base::InventorBuilder::endSeparator(), and Part::Tools::getTriangulation().
void TopoShape::exportIges | ( | const char * | FileName | ) | const |
References Part::encodeFilename().
Referenced by write().
void TopoShape::exportLineSet | ( | std::ostream & | str | ) | const |
void TopoShape::exportStep | ( | const char * | FileName | ) | const |
References Part::encodeFilename().
Referenced by write().
void TopoShape::exportStl | ( | const char * | FileName, |
double | deflection | ||
) | const |
References Part::encodeFilename().
Referenced by write().
bool TopoShape::findPlane | ( | gp_Pln & | pln, |
double | tol = -1 |
||
) | const |
References draftgeoutils.general::vec().
Referenced by isCoplanar().
bool TopoShape::fix | ( | double | precision, |
double | mintol, | ||
double | maxtol | ||
) |
References fix(), and isValid().
Referenced by fix(), makeWires(), and removeInternalWires().
TopoDS_Shape TopoShape::fuse | ( | const std::vector< TopoDS_Shape > & | shapes, |
Standard_Real | tolerance = 0.0 |
||
) | const |
References makeShell(), and draftutils.utils::tolerance().
Referenced by drafttaskpanels.task_circulararray.TaskPanelCircularArray::create_object(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::create_object(), drafttaskpanels.task_polararray.TaskPanelPolarArray::create_object(), drafttaskpanels.task_circulararray.TaskPanelCircularArray::print_messages(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::print_messages(), drafttaskpanels.task_polararray.TaskPanelPolarArray::print_messages(), drafttaskpanels.task_circulararray.TaskPanelCircularArray::set_fuse(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::set_fuse(), drafttaskpanels.task_polararray.TaskPanelPolarArray::set_fuse(), drafttaskpanels.task_polararray.TaskPanelPolarArray::validate_input(), drafttaskpanels.task_circulararray.TaskPanelCircularArray::validate_input(), and drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::validate_input().
TopoDS_Shape TopoShape::fuse | ( | TopoDS_Shape | shape | ) | const |
References makeShell().
Referenced by drafttaskpanels.task_circulararray.TaskPanelCircularArray::create_object(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::create_object(), drafttaskpanels.task_polararray.TaskPanelPolarArray::create_object(), drafttaskpanels.task_circulararray.TaskPanelCircularArray::print_messages(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::print_messages(), drafttaskpanels.task_polararray.TaskPanelPolarArray::print_messages(), drafttaskpanels.task_circulararray.TaskPanelCircularArray::set_fuse(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::set_fuse(), drafttaskpanels.task_polararray.TaskPanelPolarArray::set_fuse(), drafttaskpanels.task_polararray.TaskPanelPolarArray::validate_input(), drafttaskpanels.task_circulararray.TaskPanelCircularArray::validate_input(), and drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::validate_input().
TopoDS_Shape TopoShape::generalFuse | ( | const std::vector< TopoDS_Shape > & | sOthers, |
Standard_Real | tolerance, | ||
std::vector< TopTools_ListOfShape > * | mapInOut = nullptr |
||
) | const |
generalFuse: run general fuse algorithm between this and shapes supplied as sOthers
sOthers | (input): list of shapes to run the algorithm between (this is automatically added to the list) |
tolerance | (input): fuzzy value (pass zero to disable fuzzyness and use shape tolerances only) |
mapInOut | (output): pointer to list of lists, to write the info which shapes in result came from which argument shape. The length of list is equal to length of sOthers+1. First element is a list of shapes that came from shape of this, and the rest are those that come from shapes in sOthers. If the info is not needed, nullptr can be passed. |
References draftutils.utils::tolerance().
|
virtual |
Bound box from the CasCade shape.
Implements Data::ComplexGeoData.
Referenced by PathSimulator::PathSim::BeginSimulation().
|
virtual |
Get the center of gravity If this method is implemented then true is returned and the center of gravity.
The default implementation only returns false.
Reimplemented from Data::ComplexGeoData.
void TopoShape::getDomains | ( | std::vector< Domain > & | domains | ) | const |
|
virtual |
Sub type list List of different subelement types it is NOT a list of the subelements itself.
Implements Data::ComplexGeoData.
|
virtual |
Get faces from object with given accuracy.
Reimplemented from Data::ComplexGeoData.
References Data::ComplexGeoData::Domain::facets, getDomains(), Data::ComplexGeoData::Domain::points, and draftgeoutils.general::v1().
|
virtual |
Get faces from segment.
Reimplemented from Data::ComplexGeoData.
References Data::ComplexGeoData::Domain::facets, Base::BaseClass::getClassTypeId(), Base::BaseClass::getTypeId(), Data::ComplexGeoData::Domain::points, TopoShape(), and draftgeoutils.general::v1().
|
virtual |
Get lines from segment.
Reimplemented from Data::ComplexGeoData.
References Base::BaseClass::getClassTypeId(), Part::Tools::getPolygon3D(), Part::Tools::getPolygonOnTriangulation(), and Base::BaseClass::getTypeId().
|
virtual |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?
Implements Base::Persistence.
|
virtual |
Get points from object with given accuracy.
Reimplemented from Data::ComplexGeoData.
References draftgeoutils.general::v1().
|
virtual |
This method returns the Python wrapper for a C++ object.
It's in the responsibility of the programmer to do the correct reference counting. Basically there are two ways how to implement that: Either always return a new Python object then reference counting is not a matter or return always the same Python object then the reference counter must be incremented by one. However, it's absolutely forbidden to return always the same Python object without incrementing the reference counter.
The default implementation returns 'None'.
Reimplemented from Base::BaseClass.
References Base::PyObjectBase::setNotTracking(), and TopoShape().
get the Topo"sub"Shape with the given name
References getSubShape(), and Part::shape2pyshape().
const TopoDS_Shape & Part::TopoShape::getShape | ( | ) | const |
Referenced by PartGui::DlgExtrusion::EdgeSelection::allow(), PartGui::SweepWidget::Private::EdgeSelection::allow(), Drawing::FeatureProjection::execute(), Part::Sweep::execute(), Part::Refine::execute(), PartDesign::Fillet::execute(), PartDesign::Thickness::execute(), PartDesign::Transformed::execute(), Path::FeatureArea::execute(), Path::FeatureShape::execute(), TechDraw::FeatureProjection::execute(), Part::Revolution::execute(), PartDesign::Body::execute(), PartDesign::Boolean::execute(), PartDesign::Chamfer::execute(), Part::Extrusion::fetchAxisLink(), Part::Revolution::fetchAxisLink(), PartGui::DlgExtrusion::findShapes(), PartDesign::DressUp::getAddSubShape(), PartDesign::DressUp::getContinuousEdges(), TechDraw::ShapeExtractor::getLocation3dFromFeat(), Fem::Constraint::getPoints(), Part::Datum::getShape(), Part::Feature::getShape(), PartDesign::MultiTransform::getTransformations(), Fem::Constraint::onChanged(), shapeType(), and FemGui::TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary().
Base::Placement TopoShape::getShapePlacement | ( | void | ) | const |
|
virtual |
TopoDS_Shape TopoShape::getSubShape | ( | const char * | Type, |
bool | silent = false |
||
) | const |
get the Topo"sub"Shape with the given name
References getSubShape(), and shapeTypeAndIndex().
Referenced by PartGui::DlgProjectionOnSurface::EdgeSelection::allow(), PartGui::DlgProjectionOnSurface::FaceSelection::allow(), PartGui::DlgRevolution::EdgeSelection::allow(), PartDesign::ShapeBinder::buildShapeFromReferences(), PartDesign::Fillet::execute(), PartDesign::Loft::execute(), PartDesign::Pipe::execute(), PartDesign::Thickness::execute(), Robot::Edge2TracObject::execute(), PartDesign::Chamfer::execute(), Surface::Extend::execute(), PartDesign::DressUp::getAddSubShape(), PartDesign::ProfileBased::getAxis(), Fem::Constraint::getBasePoint(), PartDesign::DressUp::getContinuousEdges(), Fem::Constraint::getCylinder(), Fem::Constraint::getPoints(), PartDesign::ProfileBased::getProfileWires(), getPySubShape(), getSubElement(), getSubShape(), PartDesign::LinearPattern::getTransformations(), PartDesign::Mirrored::getTransformations(), PartDesign::PolarPattern::getTransformations(), PartDesign::ProfileBased::getUpToFaceFromLinkSub(), PartDesignGui::TaskFeaturePick::makeCopy(), Fem::Constraint::onChanged(), Fem::ConstraintBearing::onChanged(), FemGui::TaskFemConstraintBearing::onSelectionChanged(), FemGui::TaskFemConstraintGear::onSelectionChanged(), Sketcher::SketchObject::rebuildExternalGeometry(), PartDesign::ProfileBased::remapSupportShape(), and Sketcher::SketchObject::validateExternalLinks().
std::vector< TopoDS_Shape > TopoShape::getSubShapes | ( | TopAbs_ShapeEnum | type = TopAbs_SHAPE | ) | const |
std::vector< TopoShape > TopoShape::getSubTopoShapes | ( | TopAbs_ShapeEnum | type = TopAbs_SHAPE | ) | const |
|
virtual |
get the transformation of the CasCade Shape
Implements Data::ComplexGeoData.
References convertToMatrix().
Referenced by PartDesign::Body::execute(), PartDesign::ShapeBinder::execute(), and Part::Feature::onChanged().
bool TopoShape::hasSubShape | ( | const char * | Type | ) | const |
References countSubShapes(), and shapeTypeAndIndex().
Referenced by PartDesign::DressUp::getAddSubShape(), and Part::Feature::getSubObject().
bool TopoShape::hasSubShape | ( | TopAbs_ShapeEnum | type | ) | const |
void TopoShape::importBinary | ( | std::istream & | str | ) |
void TopoShape::importBrep | ( | const char * | FileName | ) |
References Part::encodeFilename().
Referenced by Part::ImportBrep::execute(), and read().
void TopoShape::importBrep | ( | std::istream & | str, |
int | indicator = 1 |
||
) |
void TopoShape::importIges | ( | const char * | FileName | ) |
Example code to get the labels for each face in an IGES file.
References Part::encodeFilename().
Referenced by Part::ImportIges::execute(), and read().
void TopoShape::importStep | ( | const char * | FileName | ) |
References Part::encodeFilename().
Referenced by Part::ImportStep::execute(), and read().
bool TopoShape::isClosed | ( | ) | const |
Referenced by makeLoft().
References findPlane(), and isNull().
bool TopoShape::isInfinite | ( | ) | const |
Returns true if the expansion of the shape is infinite, false otherwise.
bool TopoShape::isNull | ( | ) | const |
Referenced by PartGui::SweepWidget::accept(), PartGui::DlgExtrusion::EdgeSelection::allow(), PartGui::DlgRevolution::EdgeSelection::allow(), PartGui::SweepWidget::Private::EdgeSelection::allow(), PartGui::CrossSections::apply(), PartDesign::Transformed::execute(), PartGui::DlgExtrusion::findShapes(), PartDesign::DressUp::getAddSubShape(), Fem::Constraint::getCylinder(), Fem::Constraint::getPoints(), PartGui::getShapesFromSelection(), isCoplanar(), SurfaceGui::FillingPanel::open(), and shapeType().
TopoShape Part::TopoShape::makeFace | ( | const char * | op = nullptr , |
const char * | maker = nullptr |
||
) | const |
References makeFace().
TopoShape & TopoShape::makeFace | ( | const std::vector< TopoShape > & | shapes, |
const char * | op = nullptr , |
||
const char * | maker = nullptr |
||
) |
References Part::FaceMaker::ConstructFromType().
Referenced by makeFace().
TopoShape & TopoShape::makeFace | ( | const TopoShape & | shape, |
const char * | op = nullptr , |
||
const char * | maker = nullptr |
||
) |
References makeFace().
TopoShape Part::TopoShape::makeGTransform | ( | const Base::Matrix4D & | mat, |
const char * | op = nullptr , |
||
bool | copy = false |
||
) | const |
References makeGTransform().
TopoShape & TopoShape::makeGTransform | ( | const TopoShape & | shape, |
const Base::Matrix4D & | mat, | ||
const char * | op = nullptr , |
||
bool | copy = false |
||
) |
Referenced by makeGTransform(), and transformGeometry().
TopoDS_Shape TopoShape::makeHelix | ( | Standard_Real | pitch, |
Standard_Real | height, | ||
Standard_Real | radius, | ||
Standard_Real | angle = 0 , |
||
Standard_Boolean | left = Standard_False , |
||
Standard_Boolean | style = Standard_False |
||
) | const |
References draftfunctions.move::move(), and Base::toRadians().
TopoDS_Shape TopoShape::makeLoft | ( | const TopTools_ListOfShape & | profiles, |
Standard_Boolean | isSolid, | ||
Standard_Boolean | isRuled, | ||
Standard_Boolean | isClosed = Standard_False , |
||
Standard_Integer | maxDegree = 5 |
||
) | const |
References Base::Console(), isClosed(), and Base::ConsoleSingleton::Message().
Referenced by Part::Loft::execute().
TopoDS_Shape TopoShape::makeLongHelix | ( | Standard_Real | pitch, |
Standard_Real | height, | ||
Standard_Real | radius, | ||
Standard_Real | angle = 0 , |
||
Standard_Boolean | left = Standard_False |
||
) | const |
References draftfunctions.move::move(), and Base::toRadians().
TopoDS_Shape TopoShape::makeOffset2D | ( | double | offset, |
short | joinType = 0 , |
||
bool | fill = false , |
||
bool | allowOpenResult = false , |
||
bool | intersection = false |
||
) | const |
References Part::BRepOffsetAPI_MakeOffsetFix::AddWire(), Part::FaceMaker::addWire(), Part::FaceMaker::Build(), draftfunctions.move::move(), Part::BRepOffsetAPI_MakeOffsetFix::Perform(), Part::BRepOffsetAPI_MakeOffsetFix::Replace(), Part::FaceMakerBullseye::setPlane(), Part::BRepOffsetAPI_MakeOffsetFix::Shape(), and TopoShape().
Referenced by Part::Offset2D::execute().
TopoDS_Shape TopoShape::makeOffsetShape | ( | double | offset, |
double | tol, | ||
bool | intersection = false , |
||
bool | selfInter = false , |
||
short | offsetMode = 0 , |
||
short | join = 0 , |
||
bool | fill = false |
||
) | const |
References draftgeoutils.offsets::offsetWire().
Referenced by Part::Offset::execute().
TopoDS_Shape TopoShape::makePipe | ( | const TopoDS_Shape & | profile | ) | const |
Sweeping.
TopoDS_Shape TopoShape::makePipeShell | ( | const TopTools_ListOfShape & | profiles, |
const Standard_Boolean | make_solid, | ||
const Standard_Boolean | isFrenet = Standard_False , |
||
int | transition = 0 |
||
) | const |
TopoDS_Shape TopoShape::makePrism | ( | const gp_Vec & | vec | ) | const |
References draftgeoutils.general::vec().
References makeRefine().
TopoShape & TopoShape::makeRefine | ( | const TopoShape & | shape, |
const char * | op = nullptr , |
||
bool | no_fail = true |
||
) |
Referenced by makeRefine().
TopoDS_Shape TopoShape::makeShell | ( | const TopoDS_Shape & | input | ) | const |
TopoShape::makeShell If the input shape is a compound with faces not being part of a shell it tries to make a shell.
If this operation fails or if the input shape is not a compound or a compound with not only faces the input shape is returned.
TopoDS_Shape TopoShape::makeSpiralHelix | ( | Standard_Real | radiusbottom, |
Standard_Real | radiustop, | ||
Standard_Real | height, | ||
Standard_Real | nbturns = 1 , |
||
Standard_Real | breakperiod = 1 , |
||
Standard_Boolean | left = Standard_False |
||
) | const |
References draftfunctions.move::move().
Referenced by PartDesign::Helix::generateHelixPath().
TopoDS_Shape TopoShape::makeSweep | ( | const TopoDS_Shape & | profile, |
double | tol, | ||
int | fillMode | ||
) | const |
TopoDS_Shape TopoShape::makeThickSolid | ( | const TopTools_ListOfShape & | remFace, |
double | offset, | ||
double | tol, | ||
bool | intersection = false , |
||
bool | selfInter = false , |
||
short | offsetMode = 0 , |
||
short | join = 0 |
||
) | const |
Referenced by Part::Thickness::execute(), and PartDesign::Thickness::execute().
TopoDS_Shape TopoShape::makeThread | ( | Standard_Real | pitch, |
Standard_Real | depth, | ||
Standard_Real | height, | ||
Standard_Real | radius | ||
) | const |
TopoDS_Shape TopoShape::makeTorus | ( | Standard_Real | radius1, |
Standard_Real | radius2, | ||
Standard_Real | angle1, | ||
Standard_Real | angle2, | ||
Standard_Real | angle3, | ||
Standard_Boolean | isSolid = Standard_True |
||
) | const |
Referenced by Part::Torus::execute().
TopoShape Part::TopoShape::makeTransform | ( | const Base::Matrix4D & | mat, |
const char * | op = nullptr , |
||
bool | checkScale = false , |
||
bool | copy = false |
||
) | const |
References makeTransform().
TopoShape Part::TopoShape::makeTransform | ( | const gp_Trsf & | trsf, |
const char * | op = nullptr , |
||
bool | copy = false |
||
) | const |
References makeTransform().
TopoShape & Part::TopoShape::makeTransform | ( | const TopoShape & | shape, |
const Base::Matrix4D & | mat, | ||
const char * | op = nullptr , |
||
bool | checkScale = false , |
||
bool | copy = false |
||
) |
Referenced by PartDesign::Transformed::execute(), and makeTransform().
TopoShape & TopoShape::makeTransform | ( | const TopoShape & | shape, |
const gp_Trsf & | trsf, | ||
const char * | op = nullptr , |
||
bool | copy = false |
||
) |
References Data::ComplexGeoData::Tag.
TopoDS_Shape TopoShape::makeTube | ( | double | radius, |
double | tol, | ||
int | cont, | ||
int | maxdeg, | ||
int | maxsegm | ||
) | const |
References draftgeoutils.general::v1().
TopoShape Part::TopoShape::makeWires | ( | const char * | op = nullptr , |
bool | fix = false , |
||
double | tol = 0.0 |
||
) | const |
References makeWires().
TopoShape & TopoShape::makeWires | ( | const TopoShape & | shape, |
const char * | op = nullptr , |
||
bool | fix = false , |
||
double | tol = 0.0 |
||
) |
References fix(), and makeCompound().
Referenced by makeWires().
TopoDS_Shape TopoShape::mirror | ( | const gp_Ax2 & | ax2 | ) | const |
void Part::TopoShape::move | ( | const TopLoc_Location & | loc | ) |
TopoShape Part::TopoShape::moved | ( | const TopLoc_Location & | loc | ) | const |
TopoDS_Shape TopoShape::oldFuse | ( | TopoDS_Shape | shape | ) | const |
void TopoShape::operator= | ( | const TopoShape & | sh | ) |
References Data::ComplexGeoData::Tag.
void TopoShape::read | ( | const char * | FileName | ) |
TopoDS_Shape TopoShape::removeShape | ( | const std::vector< TopoDS_Shape > & | s | ) | const |
TopoDS_Shape TopoShape::removeSplitter | ( | ) | const |
TopoDS_Shape TopoShape::replaceShape | ( | const std::vector< std::pair< TopoDS_Shape, TopoDS_Shape > > & | s | ) | const |
|
virtual |
This method is used to restore properties from an XML document.
It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:
Implements Base::Persistence.
|
virtual |
This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data.
Again you have to apply for the call of this method in the Restore() call:
After you issued the reader.addFile() your RestoreDocFile() is called:
Reimplemented from Base::Persistence.
TopoDS_Shape TopoShape::revolve | ( | const gp_Ax1 & | axis, |
double | d, | ||
Standard_Boolean | isSolid = Standard_False |
||
) | const |
revolve shape. Note: isSolid is deprecated (instead, use some Part::FaceMaker to make a face, first).
References Base::Console(), and Base::ConsoleSingleton::Message().
Referenced by Part::Revolution::execute().
|
virtual |
This method is used to save properties to an XML document.
A good example you'll find in PropertyStandard.cpp, e.g. the vector:
The writer.ind() expression writes the indentation, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.
Implements Base::Persistence.
|
virtual |
This method is used to save large amounts of data to a binary file.
Sometimes it makes no sense to write property data as XML. In case the amount of data is too big or the data type has a more effective way to save itself. In this cases it is possible to write the data in a separate file inside the document archive. In case you want do so you have to re-implement SaveDocFile(). First, you have to inform the framework in Save() that you want do so. Here an example from the Mesh module which can save a (pontetionaly big) triangle mesh:
The writer.isForceXML() is an indication to force you to write XML. Regardless of size and effectiveness. The second part informs the Base::writer through writer.addFile("MeshKernel.bms", this) that this object wants to write a file with the given name. The method addFile() returns a unique name that then is written in the XML stream. This allows your RestoreDocFile() method to identify and read the file again. Later your SaveDocFile() method is called as many times as you issued the addFile() call:
In this method you can simply stream your content to the file (Base::Writer inheriting from ostream).
Reimplemented from Base::Persistence.
TopoDS_Shape TopoShape::section | ( | const std::vector< TopoDS_Shape > & | shapes, |
Standard_Real | tolerance = 0.0 , |
||
Standard_Boolean | approximate = Standard_False |
||
) | const |
References draftutils.utils::tolerance().
TopoDS_Shape TopoShape::section | ( | TopoDS_Shape | shape, |
Standard_Boolean | approximate = Standard_False |
||
) | const |
void TopoShape::setFaces | ( | const std::vector< Base::Vector3d > & | Points, |
const std::vector< Facet > & | faces, | ||
double | tolerance = 1.0e-06 |
||
) |
References draftutils.utils::tolerance().
|
virtual |
Reimplemented from Base::BaseClass.
void Part::TopoShape::setShape | ( | const TopoDS_Shape & | shape | ) |
Referenced by Part::Revolution::execute().
void TopoShape::setShapePlacement | ( | const Base::Placement & | rclTrf | ) |
set the transformation of the CasCade Shape
\obsolete
References DraftVecUtils::angle(), Base::Placement::getPosition(), Base::Placement::getRotation(), Base::Rotation::getValue(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
|
virtual |
set the transformation of the CasCade Shape
Implements Data::ComplexGeoData.
References convertTogpTrsf().
Referenced by PartDesign::Fillet::execute(), PartDesign::Transformed::execute(), and PartDesign::Chamfer::execute().
void TopoShape::sewShape | ( | double | tolerance = 1.0e-06 | ) |
References draftutils.utils::tolerance().
const std::string & TopoShape::shapeName | ( | bool | silent = false | ) | const |
References shapeName(), and shapeType().
|
static |
Referenced by PartDesign::Fillet::execute(), PartDesign::Chamfer::execute(), shapeName(), and shapeTypeAndIndex().
TopAbs_ShapeEnum TopoShape::shapeType | ( | bool | silent = false | ) | const |
References getShape(), and isNull().
|
static |
|
static |
References Data::ComplexGeoData::hasMissingElement().
Referenced by countSubShapes(), shapeName(), and shapeTypeAndIndex().
|
static |
References shapeName(), and shapeType().
Referenced by getSubShape(), and hasSubShape().
std::list< TopoDS_Wire > TopoShape::slice | ( | const Base::Vector3d & | dir, |
double | d | ||
) | const |
TopoDS_Compound TopoShape::slices | ( | const Base::Vector3d & | dir, |
const std::vector< double > & | d | ||
) | const |
TopoDS_Shape TopoShape::toNurbs | ( | ) | const |
|
virtual |
Applies a transformation on the real geometric data type.
Implements Data::ComplexGeoData.
References makeGTransform().
TopoDS_Shape TopoShape::transformGShape | ( | const Base::Matrix4D & | rclTrf, |
bool | copy = false |
||
) | const |
bool TopoShape::transformShape | ( | const Base::Matrix4D & | rclTrf, |
bool | copy, | ||
bool | checkScale = false |
||
) |
References TopoShape().
Referenced by PartDesign::Body::execute(), DraftUtils::DraftDxfRead::OnReadInsert(), and Import::ImpExpDxfRead::OnReadInsert().
void TopoShape::write | ( | const char * | FileName | ) | const |
References exportBrep(), exportIges(), exportStep(), exportStl(), Base::FileInfo::filePath(), and Base::FileInfo::hasExtension().
Referenced by gzip_utf8.GzipFile::seek().