OpenLexocad  27.1
Topo::ShapeTool Class Reference

Tools for creating, manipulating and querying Shapes. More...

#include <ShapeTool.h>

Public Types

enum  BuildingElementHintEnum {
  BuildingElementHintEnum::NO_HINT, BuildingElementHintEnum::BEAM_HINT, BuildingElementHintEnum::COLUMN_HINT, BuildingElementHintEnum::DOOR_HINT,
  BuildingElementHintEnum::MEMBER_HINT, BuildingElementHintEnum::PLATE_HINT, BuildingElementHintEnum::SLAB_HINT, BuildingElementHintEnum::WALL_HINT,
  BuildingElementHintEnum::WINDOW_HINT
}
 

Public Member Functions

 ShapeTool (void)
 
virtual ~ShapeTool (void)
 

Static Public Member Functions

static pShape makeShape (pVertex vertex)
 Makes a shape from a single vertex. More...
 
static pShape makeShape (pEdge edge)
 Makes a shape from a single edge. More...
 
static pShape makeShape (pWire wire, double precision=Geom::Precision::linear_Resolution())
 Makes a shape from a single wire. More...
 
static pShape makeShape (pFace face)
 Makes a shape from a single face. More...
 
static pShape makeShape (pConstBrepData data, std::vector< PNTS > &defectPolygons)
 Makes a shape from BrepData. More...
 
static pShape makeShape (BODY *aBody)
 Makes a shape from Acis BODY. More...
 
static pShape makeLazyFacetedBrepShape (pConstBrepData data, std::vector< PNTS > &defectPolygons)
 Makes a shape from BrepData. More...
 
static pShape makeInventorMeshShape (pIndexedMesh)
 Makes a mesh-shape from IndexedData. More...
 
static pShape makeInventorMeshShape (pConstBrepData data, std::vector< PNTS > &defectPolygons)
 Makes a mesh-shape from BrepData. More...
 
static pShape makeOMFMeshShape (pConstBrepData data, std::vector< PNTS > &defectPolygons)
 Makes a mesh-shape from BrepData. More...
 
static pIndexedMesh makeIndexedMesh (pConstBrepData data, std::vector< PNTS > &defectPolygons, bool createEdges=false)
 Makes a indexed-Mesh from BrepData. More...
 
static pIndexedMesh makeIndexedMesh (pConstShape input, bool createEdges=false)
 Makes a indexed-Mesh from shape. More...
 
static pShape makeAcisShape (pShape input)
 Make Acis-Shape. More...
 
static bool createBrepData (pConstShape input, pBrepData data)
 Create BrepData. More...
 
static void makeShapeAsync (pConstBrepData data, std::function< void(pShape newShape, std::vector< PNTS > defectPolygons)> onShapeMadeCB)
 Makes a shape from BrepData. More...
 
static pShape makeShape (const std::vector< int > &model, const std::vector< Geom::Pnt > &vertices, std::vector< PNTS > &defectPolygons)
 Makes a shape from BrepData. More...
 
static pShape makeShape (const std::vector< Base::Int > &model, const std::vector< Geom::Pnt > &vertices, std::vector< PNTS > &defectPolygons)
 Makes a shape from BrepData. More...
 
static void makeShapeAsync (const std::vector< int > &model, const std::vector< Geom::Pnt > &vertices, std::function< void(pShape newShape, std::vector< PNTS > defectPolygons)> onShapeMadeCB)
 Makes a shape from BrepData. More...
 
static bool makeShapes_parallel (const std::vector< pConstBrepData > &breps, std::map< pConstBrepData, pShape > &shapes)
 Makes shapes from BrepData in parallel. More...
 
static pShape makeShape (const std::vector< pFace > &faces, double precision=Geom::Precision::linear_Resolution())
 
static pShape makeFaceSet (const std::vector< pFace > &faces)
 Makes a shape from a vector of pFaces. The faces are not stitched together and may be unconnected. More...
 
static pShape makeFaceSet (pConstBrepData data)
 Makes a shape from BrepData. The faces are not stitched together and may be unconnected. No faces with voids are allowed!!! More...
 
static pShape makeCompound (const std::vector< pConstShape > &shapes)
 
static pShape makeShape (Core::DocObject *curve, double startParam=0, double endParam=0)
 Makes a shape from a curve. If the curve is bounded startParam and endParam can be omitted. More...
 
static int getLumpsCount (pConstTopologicalItem item)
 Returns the number of lumps in the shape. More...
 
static int getFaceCount (pConstTopologicalItem item)
 Returns the number of faces in the shape. More...
 
static int getWireCount (pConstTopologicalItem item)
 Returns the number of wires in the shape. More...
 
static int getEdgeCount (pConstTopologicalItem item)
 Returns the number of edges in the shape. More...
 
static int getVertexCount (pConstTopologicalItem item)
 Returns the number of vertices in the shape. More...
 
static int getPolygonCount (pConstTopologicalItem item, Topo::ShapeTessellationQuality quality)
 Returns number of polygons in a shape. More...
 
static pConstFace getFaceByIndex (pConstTopologicalItem item, int idx)
 Returns the face at index 'idx'. Returns nullptr if index is out of bounds. More...
 
static pConstWire getWireByIndex (pConstTopologicalItem item, int idx)
 Returns the wire at index 'idx'. Returns nullptr if index is out of bounds. More...
 
static pConstEdge getEdgeByIndex (pConstTopologicalItem item, int idx)
 Returns the edge at index 'idx'. Returns nullptr if index is out of bounds. More...
 
static pConstVertex getVertexByIndex (pConstTopologicalItem item, int idx)
 Returns the vertex at index 'idx'. Returns nullptr if index is out of bounds. More...
 
static int getIndexFromShell (pConstTopologicalItem item, pConstShell shell)
 Returns the index of the shell in this shape. Returns -1 if shell is not part of this shape. More...
 
static int getIndexFromFace (pConstTopologicalItem item, pConstFace face)
 Returns the index of the face in this shape. Returns -1 if face is not part of this shape. More...
 
static std::vector< int > getIndexesFromFaces (pConstTopologicalItem item, const std::vector< pConstFace > faces)
 Returns the indexes of the faces in this shape. Returns -1 if face is not part of this shape. More...
 
static int getIndexFromWire (pConstTopologicalItem item, pConstWire wire)
 Returns the index of the wire in this shape. Returns -1 if wire is not part of this shape. More...
 
static int getIndexFromEdge (pConstTopologicalItem item, pConstEdge edge)
 Returns the index of the edge in this shape. Returns -1 if edge is not part of this shape. More...
 
static int getIndexFromVertex (pConstTopologicalItem item, const Geom::Pnt &v)
 TODO -> This method is wrong since one gp_Pnt can correspond to more than one index. More...
 
static int getIndexFromVertex (pConstTopologicalItem item, pConstVertex vtx)
 Return the index of vertex 'vtx'. Returns -1 if vertex is not part of this shape. More...
 
static std::vector< pConstShellgetShells (pConstTopologicalItem item)
 Returns the shells of the shape. More...
 
static std::vector< pConstFacegetFaces (pConstTopologicalItem item)
 Returns the faces of the shape. More...
 
static std::vector< pFacegetFacesAsCopy (pConstTopologicalItem item)
 Returns the faces of the shape as Copy. More...
 
static std::vector< pConstWiregetWires (pConstTopologicalItem item)
 Returns the wires of the shape. More...
 
static std::vector< pConstEdgegetEdges (pConstTopologicalItem item)
 Returns the edges of the shape. More...
 
static std::vector< VisibleEdgegetEdges_visible (std::vector< pConstShape > shapes, const Geom::Pnt &cam_position, const Geom::Pnt &cam_target, bool cam_perspective=true)
 Returns the visible edges of the shape. More...
 
static std::vector< pConstVertexgetVertices (pConstTopologicalItem item)
 Returns the vertices of the shape. More...
 
static std::vector< int > getAdjacentFaceIndicesFromVertexIndex (pConstTopologicalItem item, int vertexIdx)
 Returns the indices of all faces that contain the vertex of index 'vertexIdx'. More...
 
static std::vector< pConstFacegetAdjacentFacesFromEdge (pConstTopologicalItem item, pConstEdge edge)
 Returns all adjacent faces of an edge in a shape. More...
 
static std::vector< int > getEdgeIndicesFromFace (pConstTopologicalItem item, int faceIndex)
 Returns edge indices of the face with index 'faceIndex'. More...
 
static std::vector< int > getVertexIndicesFromWire (pConstTopologicalItem item, int wireIdx)
 Returns sorted vertex indices of the wire with index 'wireIdx'. More...
 
static std::vector< int > getWireIndicesFromFace (pConstTopologicalItem item, int faceIdx)
 Returns wire indices of the face with index 'faceIdx'. More...
 
static void getVerticesAsPoints (pConstTopologicalItem item, std::vector< Geom::Pnt > &vertices)
 Returns the vertices of a shape as a vector of points. More...
 
static Geom::Bnd_Box getBoundingBox (pConstTopologicalItem item)
 Returns the bounding box of the shape. More...
 
static Geom::Trsf getTransform (pConstShape shape)
 Returns the transform of the shape. More...
 
static bool calculateLocalAxes (pConstShape shape, Geom::Ax2 &localAxes)
 
static bool calculateDetail (pConstShape shape, CA_Detail &detail, const CA_Snap &snap)
 
static pSolid cast2Solid (pShape shape)
 Casts a shape to a solid. Returns nullptr if cast is not possible. More...
 
static pCompound cast2Compound (pShape shape)
 Casts a shape to a compound. Returns nullptr if cast is not possible. More...
 
static pMesh cast2Mesh (pShape shape)
 Casts a shape to a mesh. Returns nullptr if cast is not possible. More...
 
static pConstSolid cast2ConstSolid (pConstShape shape)
 Casts a shape to a solid. Returns nullptr if cast is not possible. More...
 
static pConstCompound cast2ConstCompound (pConstShape shape)
 Casts a shape to a compound. Returns nullptr if cast is not possible. More...
 
static pConstMesh cast2ConstMesh (pConstShape shape)
 Casts a shape to a mesh. Returns nullptr if cast is not possible. More...
 
static double getVolume (pConstTopologicalItem item)
 Returns the volume of a shape. Returns 0 if shape has no volume. More...
 
static bool getCentroid (pConstShape shape, Geom::Pnt &centroid)
 Computes the center of gravity of a shape. Returns false in case of error. More...
 
static void setNeedMassUpdate (pConstShape shape, bool on)
 
static bool write (pConstShape shape, std::ostream &writer)
 Writes a shape to ostream. More...
 
static bool write (pConstShape shape, Base::AbstractWriter &writer)
 Writes a shape to ostream. More...
 
static bool write (const std::string &format, pConstShape shape, const Base::String &fileName)
 Writes the shape in the give format. More...
 
static bool write (const std::string &format, std::vector< pConstShape > shapes, const Base::String &fileName)
 Writes the shapes in the give format. More...
 
static bool writeAcisFile (std::vector< pConstShape > shapes, const Base::String &fileName, bool isText, int major_version=-1, int minor_version=-1, double scale=1.)
 
static bool appendAcisFile (std::vector< pConstShape > shapes, const Base::String &fileName, bool isText, int major_version=-1, int minor_version=-1, double scale=1.)
 
static bool canWriteAs (const std::string &format, pConstShape shape)
 Checks if shape can be written in given format. More...
 
static std::string getWriteFormat (pConstShape shape)
 Returns the save format. More...
 
static pShape read (const std::string &format, std::istream &reader)
 Reads a shape from istream in given format. More...
 
static pShape read (const std::string &format, const std::string &data, float version)
 Reads shape in given format from data. More...
 
static pShape read (const std::string &format, const std::string &fileName)
 Reads shape from fileName in given format. More...
 
static pShape read (const std::string &format, const Base::String &fileName)
 Reads shape from fileName in given format. More...
 
static pShape transformed (pConstShape base, const Geom::Trsf &t)
 Creates a copy of the shape and transforms the copy. More...
 
static pShape scaled (pConstShape base, const Geom::XYZ &scale)
 Creates a copy of the shape and scales the copy. The scale can be non-uniform. More...
 
static bool isNull (pConstShape shape)
 Checks if the shape is Null. More...
 
static bool isValid (pConstShape shape, int checkLevel=30)
 Checks if the shape is valid. Check level can be between 10 (fast, but not profound) and 70 (slow and profound) More...
 
static bool isValid (pConstWire wire, int checkLevel=30)
 Checks if the shape is valid. Check level can be between 10 (fast, but not profound) and 70 (slow and profound) More...
 
static bool isValid (pConstFace face, int checkLevel=30)
 Checks if the shape is valid. Check level can be between 10 (fast, but not profound) and 70 (slow and profound) More...
 
static bool isValid (pConstVertex vertex, int checkLevel=30)
 Checks if the shape is valid. Check level can be between 10 (fast, but not profound) and 70 (slow and profound) More...
 
static bool isValid (pConstEdge edge, int checkLevel=30)
 Checks if the shape is valid. Check level can be between 10 (fast, but not profound) and 70 (slow and profound) More...
 
static bool isValidInCadwork3d (pConstTopologicalItem shape)
 Checks if the shape is valid in cadwork3d. The checking level and type of checking are identical to the one in cadwork3d. More...
 
static bool isEqual (pConstTopologicalItem shape1, pConstTopologicalItem shape2)
 Checks if TopologicalItems are equal. Two items are equal if they have the same underlying pointer. More...
 
static Topo::GeometricInformation getGeometricInformation (pConstTopologicalItem item)
 Returns geometric information about the item (like mass etc.) More...
 
static void getAxesOrientedSurfaces (pConstShape shape, double &XYSurface, double &XZSurface, double &YZSurface)
 Returns geometric information about the horizontal and vertical faces of the shape. More...
 
static void getVerticalAndHorizontalFaceAreas (pConstShape shape, double &verticalFaceSurface, std::vector< double > &verticalFaceSurfaces, double &verticalLargestFaceSurface, double &horizontalFaceSurface)
 
static void getVerticalAndHorizontalFaceAreas (pConstShape shape, Base::Double &verticalFaceSurface, std::vector< double > &verticalFaceSurfaces, Base::Double &verticalLargestFaceSurface, Base::Double &horizontalFaceSurface)
 Returns geometric information about the horizontal and vertical faces of the shape. More...
 
static double getAreaFromTop (pConstShape shape, pMesh *areFromTopMesh=nullptr)
 Returns area from top (?) More...
 
static double getLargestFaceArea (pConstShape shape)
 
static pShape copy (pConstShape shape, bool deepCopy=true)
 Makes a copy of the shape. More...
 
static App::Element * makeDbgElementFromShape (Core::CoreDocument *doc, pConstShape shape, const Base::Color &color=Base::Color(204, 204, 204))
 Returns a test element - for testing only! More...
 
static App::SubElement * makeDbgSubElementFromShape (Core::CoreDocument *doc, pConstShape shape, const Base::Color &color=Base::Color(204, 204, 204))
 Returns a test element - for testing only! More...
 
static pMesh triangulationToMesh (pConstShape shape)
 
static bool isFaceted (pConstTopologicalItem shape)
 Checks if the shape consists only of planar faces. More...
 
static bool hasVoids (pConstTopologicalItem shape)
 Checks if any of the faces in shape has voids. More...
 
static pShape mergePlanarFaces (pConstShape shape)
 Returns a new shape where all planar faces of 'shape' are merged. More...
 
static bool convertToPolygonalFaces (pConstShape shape, std::vector< pFace > &polyFaces, bool precise=false)
 Converts an advanced BRep (with NURBS) into a faceted BRep. More...
 
static bool hasNurbsFace (pConstShape shape)
 Returns true if at least one of the shape's faces is NURBS face (see Topo::FaceTool::isNurbs()) More...
 
static bool hasTriangulation (pConstShape shape)
 Checks if the shape has a triangulation ( = the shape is tessellated ) More...
 
static pConstVertex getClosestVertexToPoint (pConstTopologicalItem item, const Geom::Pnt &p)
 Returns vertex of the shape that is closest to the given point (if there are more vertices in the same distance returns the first one found) More...
 
static bool hasFaces (pConstShape shape, bool &allSubShapesHaveFaces)
 
static std::vector< pShapegetShapesFromAcisFile (const Base::String &fileName, double scaleFactor=1., std::function< int(int)> callback=0)
 Reads in a SAT file and converts each ACIS BODY into a pShape. More...
 
static pShape importBrep (Base::String filename)
 Read a Brep. More...
 
static pShape extrudedWire (pConstWire wire, const Geom::Dir &extrudedDirection, double depth, double precision)
 Extrudes a wire in the given extrudedDirection with the given depth. It returns nullptr on failure. More...
 
static pShape thickenSheets (pConstShape shape, double thickness, bool doubleSided=false, Base::String &errorInfo=Base::String())
 Thickens a shape consisting of sheets. If input shape is not a single sided sheet the function tries to convert it into one. More...
 
static pShape deformed (pConstShape shape, const Geom::GTrsf &t, const Geom::Pnt &p)
 Returns a deformed shape, based on a base point and a transformation. More...
 
static pShape mirrored (pConstShape shape, const Geom::Ax2 &ax)
 Returns a mirrored shape. More...
 
static Topo::ToolOutcome clash (pConstShape shape1, pConstShape shape2, bool &hasClash)
 Performs a clash of two shapes and reports if they touch one another. More...
 
static Topo::ToolOutcome clashBodies (pConstShape shape1, pConstShape shape2, Topo::BodyClashType &clashType, Topo::ClashMode clashMode=Topo::ClashMode::CLASH_CLASSIFY_BODIES)
 Perform a real clash of two shapes and report the way in which these shapes clash. More...
 
static pConstWire isSingleWire (pConstShape shape)
 Checks if the shape consists of one single wire and no faces. Returns the wire or nullptr. More...
 
static pConstFace isSingleFace (pConstShape shape)
 Checks if the shape consists of one single face. Returns the face or nullptr. More...
 
static pConstEdge isSingleEdge (pConstShape shape)
 Checks if the shape consists of one single wire with one edge and no faces. Returns the edge or nullptr. More...
 
static pConstVertex isSingleVertex (pConstShape shape)
 Checks if the shape consists of one wire with a single vertex but no edges or faces. Returns the vertex or nullptr. More...
 
static bool isShell (pConstShape shape)
 Checks if the shape is an open or closed shell. More...
 
static bool isOpenShell (pConstShape shape)
 Checks if the shape is an open shell. More...
 
static bool isClosedShell (pConstShape shape)
 Checks if the shape is a closed shell. More...
 
static bool isClosedSolid (pConstShape shape)
 Checks if the shape is a closed solid. More...
 
static bool isWire (pConstShape shape)
 Checks if the shape is a wire. More...
 
static bool isCompound (pConstShape shape)
 Checks if the shape consists of more than one sub-shape. More...
 
static bool isMesh (pConstShape shape)
 Checks if the shape is a mesh. More...
 
static bool isVertex (pConstShape shape)
 Checks if the shape is a vertex. More...
 
static bool isExtrudedAreaSolid (pConstShape aShape, Geom::Ax2 &aPosition, double &aLength, pConstFace &aProfile, BuildingElementHintEnum aHint=BuildingElementHintEnum::NO_HINT)
 Checks if shape is an ExtrudedAreaSolid and returns the parameters. More...
 
static bool isCylinder (pConstShape shape, Geom::Ax2 &position, double &length, double &radius)
 Checks if shape is a cylinder and returns the parameters. More...
 
static bool getAttributeInteger (pConstTopologicalItem shape, const Base::String &name, int &value)
 Get Attribute from Shape. More...
 
static bool setAttributeInteger (pConstTopologicalItem shape, const Base::String &name, int value)
 Set Attribute to Shape. More...
 
static bool removeAttribute (pConstTopologicalItem shape, const Base::String &name)
 Remove Attribute from Shape. More...
 
static bool getAttributeString (pConstTopologicalItem shape, const Base::String &name, Base::String &)
 Get Attribute to Shape. More...
 
static bool setAttributeString (pConstTopologicalItem shape, const Base::String &name, const Base::String &)
 Set Attribute to Shape. More...
 
static bool setAttributeStringNonCopy (pConstTopologicalItem shape, const Base::String &name, const Base::String &)
 Set Attribute to Shape, Don't copy attribute at Copy/Slip/Merge. More...
 
static size_t getAttributeCount (pConstTopologicalItem shape)
 Get Attribute-Count. More...
 
static bool setCdwkSATAttributes (pConstShape shape, const Topo::Cdwk_SAT_Attributes &att)
 Sets the cadwork SAT attributes. More...
 
static void releaseCdwkSATAttributes (pConstShape shape)
 Deletes the cadwork SAT attributes. More...
 
static bool cleanupShape (pShape shape)
 Removes all unnecessary faces, wires, edges of the shape. More...
 
static bool hasSliverFaces (pConstShape shape)
 
static pShape removedSliverFaces (pConstShape shape, double aTolerance=-1)
 
static bool imprint (pShape base, pShape tool)
 Intersects two shapes and imprints the intersection graph on BOTH shapes (if a closed loop of edges is created, a new face is made). More...
 
static Topo::ToolOutcome rayPick (const std::vector< pConstTopologicalItem > &targets, const CA_Ray &ray, Topo::RayHitVector &found)
 Make a RayPick. More...
 
static void removeFaceting (pConstTopologicalItem item)
 Removes the faceting ( the triangle/mesh data ) associated with this item. More...
 
static bool getColorRGB (pConstShape shape, int &r, int &g, int &b)
 Get RGB values associated with this shape. Useful if color is defined by an ACIS attribute when importing files. More...
 
template<class _InputIterator , class _Function >
static void do_parallel (_InputIterator first, _InputIterator last, _Function fn)
 
static pShape skinning (Base::String &errorInfo, const Topo::SkinningOptions &skinOptions, const double &precision=Geom::Precision::linear_Resolution())
 
static pShape sweeping (Base::String &errorInfo, const Topo::SweepingOptions &sweepOptions)
 
static double getModelingTolerance ()
 Returns the global resolution absolute. More...
 
static Topo::ThreadPoolgetThreadPool ()
 
static void transformShape2LocalSpaceOfElement (App::Element *elem, pShape shape)
 
static bool hasPolyHedral ()
 
static bool getModelFromPolyHedral (pShape shape, std::vector< int > &model, std::vector< Geom::Pnt > &vertices)
 
static pShape makePolyHedral (const std::vector< int > &model, const std::vector< Geom::Pnt > &vertices, bool checkShape, std::vector< std::vector< Geom::Pnt > > &defectPolygons)
 
static bool is_polyhedral_body (BODY const *iBody)
 
static std::vector< Geom::PntgetIntersectionPoints (pConstShape shape, const std::vector< pConstShape > shapes)
 
static std::vector< Geom::PntgetAllIntersectionPoints (const std::vector< pConstShape > shapes)
 
static void getAllIntersectionPointsIn2DMode (const std::vector< pConstShape > &shapes, const Geom::Pnt &pnt, const double &distance, std::vector< Geom::Pnt > &intersectionPoints)
 
static void getAllIntersectionPointsWithLineIn2DMode (const std::vector< pConstShape > &shapes, const Geom::Pnt &linePnt1, const Geom::Pnt &linePnt2, std::vector< Geom::Pnt > &intersectionPoints)
 
static void getAllIntersectionPointsWithLineIn2DMode (pConstShape shape, const Geom::Pnt &linePnt1, const Geom::Pnt &linePnt2, std::vector< Geom::Pnt > &intersectionPoints)
 
static pShape createShell (pConstShape shape)
 
static pShape createSheet (pConstShape shape, bool doubleSided)
 
static std::vector< pShapesplitLumps (pConstShape shape)
 
static bool makeShapes (const std::vector< pFace > &faces, std::vector< pShape > &shapes, double precision=Geom::Precision::linear_Resolution())
 Makes an open or closed shapes from a vector of pFaces. The faces are stitched or sewn together within given tolerance if possible. More...
 
static Topo::ToolOutcome createElementFromShape (Core::CoreDocument *doc, pConstShape shape, App::Element *&newElement, App::Element *sample=0)
 create a Element More...
 
static size_t getShapeCount ()
 
static void shapeCountInc ()
 
static void shapeCountDec ()
 
static bool getBoundingBoxSizes (pConstTopologicalItem item, Geom::XYZ &sizes)
 Returns the sizes of the bounding box of the shape. More...
 
static pShape simplifyShape (pConstShape shape, const SimplifyOptions &opts)
 
static pShape offsetShape (pConstShape shape, double offset)
 
static void debugShape (pConstShape shape, int checkLevel, ShapeInfo &info)
 
static bool isManifold (pConstShape shape)
 
static bool restoreGlobalAttachment (Base::GlobalAttachment *gAtta, std::istream *, uint64_t streamsize, const Base::String &entryName)
 
static int getFaceIndexByPointOnFace (pConstTopologicalItem shape, const Geom::Pnt &p)
 
static std::vector< int > getFaceIndexesByPointOnFace (pConstTopologicalItem shape, const Geom::Pnt &p)
 
static void getFacesByMaxNormalToVectorAngle (pConstShape aShape, std::map< int, Geom::Vec > aDirectionsToSortBy, std::map< int, std::vector< pConstFace > > &aFacesListMap, float aMaxAngleRad=0.75)
 
static bool getTopoDS_Shape (pConstTopologicalItem shape, TopoDS_Shape &topoShape)
 Gets the TopoDS_Shape of 'shape'. Returns 'true' on success, 'false' if shape has no TopoDS_Shape or the TopoDS_Shape is Null. More...
 
static bool getEntityAttribute_Int (ENTITY *ent, int &v)
 
static bool setEntityAttribute_Int (ENTITY *ent, int v)
 
Boolean Operations
static bool intersectBBoxes (pConstShape shape1, pConstShape shape2)
 
static pShape cut (pConstShape base, pConstShape tool, bool *ok=0)
 
static pShape cut (pConstShape base, const std::vector< pConstShape > tools, bool *ok=0)
 
static pShape fuse (pConstShape base, pConstShape tool, bool *ok=0)
 
static pShape common (pConstShape base, pConstShape tool, bool *ok=0)
 
static pShape section (pConstShape base, pConstShape tool, bool *ok=0)
 
static pShape s_cut (pConstShape base, pConstShape tool)
 
static pShape s_common (pConstShape base, pConstShape tool)
 
static pShape cutWithPlane (pConstShape aBlank, const Geom::Pln &aPlane, bool *ok=0)
 
static pShape splitByPlane (pConstShape aBlank, const Geom::Pln &aPlane, bool *ok=0)
 

Friends

class MesherAcis::ShapeTesselator_Acis
 
class MesherAcis::TriangleData_Acis
 
class MesherAcis::EdgeData_Acis
 
class MesherAcis::facet_body_thread_worker
 

Detailed Description

Tools for creating, manipulating and querying Shapes.

Member Enumeration Documentation

◆ BuildingElementHintEnum

Enumerator
NO_HINT 
BEAM_HINT 
COLUMN_HINT 
DOOR_HINT 
MEMBER_HINT 
PLATE_HINT 
SLAB_HINT 
WALL_HINT 
WINDOW_HINT 

Constructor & Destructor Documentation

◆ ShapeTool()

Topo::ShapeTool::ShapeTool ( void  )

◆ ~ShapeTool()

virtual Topo::ShapeTool::~ShapeTool ( void  )
virtual

Member Function Documentation

◆ appendAcisFile()

static bool Topo::ShapeTool::appendAcisFile ( std::vector< pConstShape shapes,
const Base::String fileName,
bool  isText,
int  major_version = -1,
int  minor_version = -1,
double  scale = 1. 
)
static

Append the shapes in an ACIS binary or text file. ACIS Attributes should be attached to the shape before exporting them. If 'major_version == -1' it takes the latest version.

◆ calculateDetail()

static bool Topo::ShapeTool::calculateDetail ( pConstShape  shape,
CA_Detail &  detail,
const CA_Snap &  snap 
)
static

◆ calculateLocalAxes()

static bool Topo::ShapeTool::calculateLocalAxes ( pConstShape  shape,
Geom::Ax2 localAxes 
)
static

Calculates the local axes for the shape that 'fit the best'. The longest linear edge is taken as the length axis and the biggest face area's normal vector is taken as the width direction.

◆ canWriteAs()

static bool Topo::ShapeTool::canWriteAs ( const std::string &  format,
pConstShape  shape 
)
static

Checks if shape can be written in given format.

◆ cast2Compound()

static pCompound Topo::ShapeTool::cast2Compound ( pShape  shape)
static

Casts a shape to a compound. Returns nullptr if cast is not possible.

◆ cast2ConstCompound()

static pConstCompound Topo::ShapeTool::cast2ConstCompound ( pConstShape  shape)
static

Casts a shape to a compound. Returns nullptr if cast is not possible.

◆ cast2ConstMesh()

static pConstMesh Topo::ShapeTool::cast2ConstMesh ( pConstShape  shape)
static

Casts a shape to a mesh. Returns nullptr if cast is not possible.

◆ cast2ConstSolid()

static pConstSolid Topo::ShapeTool::cast2ConstSolid ( pConstShape  shape)
static

Casts a shape to a solid. Returns nullptr if cast is not possible.

◆ cast2Mesh()

static pMesh Topo::ShapeTool::cast2Mesh ( pShape  shape)
static

Casts a shape to a mesh. Returns nullptr if cast is not possible.

◆ cast2Solid()

static pSolid Topo::ShapeTool::cast2Solid ( pShape  shape)
static

Casts a shape to a solid. Returns nullptr if cast is not possible.

◆ clash()

static Topo::ToolOutcome Topo::ShapeTool::clash ( pConstShape  shape1,
pConstShape  shape2,
bool &  hasClash 
)
static

Performs a clash of two shapes and reports if they touch one another.

◆ clashBodies()

static Topo::ToolOutcome Topo::ShapeTool::clashBodies ( pConstShape  shape1,
pConstShape  shape2,
Topo::BodyClashType clashType,
Topo::ClashMode  clashMode = Topo::ClashMode::CLASH_CLASSIFY_BODIES 
)
static

Perform a real clash of two shapes and report the way in which these shapes clash.

◆ cleanupShape()

static bool Topo::ShapeTool::cleanupShape ( pShape  shape)
static

Removes all unnecessary faces, wires, edges of the shape.

◆ common()

static pShape Topo::ShapeTool::common ( pConstShape  base,
pConstShape  tool,
bool *  ok = 0 
)
static

◆ convertToPolygonalFaces()

static bool Topo::ShapeTool::convertToPolygonalFaces ( pConstShape  shape,
std::vector< pFace > &  polyFaces,
bool  precise = false 
)
static

Converts an advanced BRep (with NURBS) into a faceted BRep.

◆ copy()

static pShape Topo::ShapeTool::copy ( pConstShape  shape,
bool  deepCopy = true 
)
static

Makes a copy of the shape.

◆ createBrepData()

static bool Topo::ShapeTool::createBrepData ( pConstShape  input,
pBrepData  data 
)
static

Create BrepData.

◆ createElementFromShape()

static Topo::ToolOutcome Topo::ShapeTool::createElementFromShape ( Core::CoreDocument doc,
pConstShape  shape,
App::Element *&  newElement,
App::Element *  sample = 0 
)
static

create a Element

◆ createSheet()

static pShape Topo::ShapeTool::createSheet ( pConstShape  shape,
bool  doubleSided 
)
static

◆ createShell()

static pShape Topo::ShapeTool::createShell ( pConstShape  shape)
static

◆ cut() [1/2]

static pShape Topo::ShapeTool::cut ( pConstShape  base,
pConstShape  tool,
bool *  ok = 0 
)
static

◆ cut() [2/2]

static pShape Topo::ShapeTool::cut ( pConstShape  base,
const std::vector< pConstShape tools,
bool *  ok = 0 
)
static

◆ cutWithPlane()

static pShape Topo::ShapeTool::cutWithPlane ( pConstShape  aBlank,
const Geom::Pln aPlane,
bool *  ok = 0 
)
static

◆ debugShape()

static void Topo::ShapeTool::debugShape ( pConstShape  shape,
int  checkLevel,
ShapeInfo info 
)
static

◆ deformed()

static pShape Topo::ShapeTool::deformed ( pConstShape  shape,
const Geom::GTrsf t,
const Geom::Pnt p 
)
static

Returns a deformed shape, based on a base point and a transformation.

◆ do_parallel()

template<class _InputIterator , class _Function >
static void Topo::ShapeTool::do_parallel ( _InputIterator  first,
_InputIterator  last,
_Function  fn 
)
inlinestatic

◆ extrudedWire()

static pShape Topo::ShapeTool::extrudedWire ( pConstWire  wire,
const Geom::Dir extrudedDirection,
double  depth,
double  precision 
)
static

Extrudes a wire in the given extrudedDirection with the given depth. It returns nullptr on failure.

◆ fuse()

static pShape Topo::ShapeTool::fuse ( pConstShape  base,
pConstShape  tool,
bool *  ok = 0 
)
static

◆ getAdjacentFaceIndicesFromVertexIndex()

static std::vector<int> Topo::ShapeTool::getAdjacentFaceIndicesFromVertexIndex ( pConstTopologicalItem  item,
int  vertexIdx 
)
static

Returns the indices of all faces that contain the vertex of index 'vertexIdx'.

◆ getAdjacentFacesFromEdge()

static std::vector<pConstFace> Topo::ShapeTool::getAdjacentFacesFromEdge ( pConstTopologicalItem  item,
pConstEdge  edge 
)
static

Returns all adjacent faces of an edge in a shape.

◆ getAllIntersectionPoints()

static std::vector<Geom::Pnt> Topo::ShapeTool::getAllIntersectionPoints ( const std::vector< pConstShape shapes)
static

◆ getAllIntersectionPointsIn2DMode()

static void Topo::ShapeTool::getAllIntersectionPointsIn2DMode ( const std::vector< pConstShape > &  shapes,
const Geom::Pnt pnt,
const double &  distance,
std::vector< Geom::Pnt > &  intersectionPoints 
)
static

◆ getAllIntersectionPointsWithLineIn2DMode() [1/2]

static void Topo::ShapeTool::getAllIntersectionPointsWithLineIn2DMode ( const std::vector< pConstShape > &  shapes,
const Geom::Pnt linePnt1,
const Geom::Pnt linePnt2,
std::vector< Geom::Pnt > &  intersectionPoints 
)
static

◆ getAllIntersectionPointsWithLineIn2DMode() [2/2]

static void Topo::ShapeTool::getAllIntersectionPointsWithLineIn2DMode ( pConstShape  shape,
const Geom::Pnt linePnt1,
const Geom::Pnt linePnt2,
std::vector< Geom::Pnt > &  intersectionPoints 
)
static

◆ getAreaFromTop()

static double Topo::ShapeTool::getAreaFromTop ( pConstShape  shape,
pMesh areFromTopMesh = nullptr 
)
static

Returns area from top (?)

◆ getAttributeCount()

static size_t Topo::ShapeTool::getAttributeCount ( pConstTopologicalItem  shape)
static

Get Attribute-Count.

◆ getAttributeInteger()

static bool Topo::ShapeTool::getAttributeInteger ( pConstTopologicalItem  shape,
const Base::String name,
int &  value 
)
static

Get Attribute from Shape.

◆ getAttributeString()

static bool Topo::ShapeTool::getAttributeString ( pConstTopologicalItem  shape,
const Base::String name,
Base::String  
)
static

Get Attribute to Shape.

◆ getAxesOrientedSurfaces()

static void Topo::ShapeTool::getAxesOrientedSurfaces ( pConstShape  shape,
double &  XYSurface,
double &  XZSurface,
double &  YZSurface 
)
static

Returns geometric information about the horizontal and vertical faces of the shape.

◆ getBoundingBox()

static Geom::Bnd_Box Topo::ShapeTool::getBoundingBox ( pConstTopologicalItem  item)
static

Returns the bounding box of the shape.

◆ getBoundingBoxSizes()

static bool Topo::ShapeTool::getBoundingBoxSizes ( pConstTopologicalItem  item,
Geom::XYZ sizes 
)
static

Returns the sizes of the bounding box of the shape.

◆ getCentroid()

static bool Topo::ShapeTool::getCentroid ( pConstShape  shape,
Geom::Pnt centroid 
)
static

Computes the center of gravity of a shape. Returns false in case of error.

◆ getClosestVertexToPoint()

static pConstVertex Topo::ShapeTool::getClosestVertexToPoint ( pConstTopologicalItem  item,
const Geom::Pnt p 
)
static

Returns vertex of the shape that is closest to the given point (if there are more vertices in the same distance returns the first one found)

◆ getColorRGB()

static bool Topo::ShapeTool::getColorRGB ( pConstShape  shape,
int &  r,
int &  g,
int &  b 
)
static

Get RGB values associated with this shape. Useful if color is defined by an ACIS attribute when importing files.

◆ getEdgeByIndex()

static pConstEdge Topo::ShapeTool::getEdgeByIndex ( pConstTopologicalItem  item,
int  idx 
)
static

Returns the edge at index 'idx'. Returns nullptr if index is out of bounds.

◆ getEdgeCount()

static int Topo::ShapeTool::getEdgeCount ( pConstTopologicalItem  item)
static

Returns the number of edges in the shape.

◆ getEdgeIndicesFromFace()

static std::vector<int> Topo::ShapeTool::getEdgeIndicesFromFace ( pConstTopologicalItem  item,
int  faceIndex 
)
static

Returns edge indices of the face with index 'faceIndex'.

◆ getEdges()

static std::vector<pConstEdge> Topo::ShapeTool::getEdges ( pConstTopologicalItem  item)
static

Returns the edges of the shape.

◆ getEdges_visible()

static std::vector<VisibleEdge> Topo::ShapeTool::getEdges_visible ( std::vector< pConstShape shapes,
const Geom::Pnt cam_position,
const Geom::Pnt cam_target,
bool  cam_perspective = true 
)
static

Returns the visible edges of the shape.

◆ getEntityAttribute_Int()

static bool Topo::ShapeTool::getEntityAttribute_Int ( ENTITY *  ent,
int &  v 
)
static

◆ getFaceByIndex()

static pConstFace Topo::ShapeTool::getFaceByIndex ( pConstTopologicalItem  item,
int  idx 
)
static

Returns the face at index 'idx'. Returns nullptr if index is out of bounds.

◆ getFaceCount()

static int Topo::ShapeTool::getFaceCount ( pConstTopologicalItem  item)
static

Returns the number of faces in the shape.

◆ getFaceIndexByPointOnFace()

static int Topo::ShapeTool::getFaceIndexByPointOnFace ( pConstTopologicalItem  shape,
const Geom::Pnt p 
)
static

◆ getFaceIndexesByPointOnFace()

static std::vector<int> Topo::ShapeTool::getFaceIndexesByPointOnFace ( pConstTopologicalItem  shape,
const Geom::Pnt p 
)
static

◆ getFaces()

static std::vector<pConstFace> Topo::ShapeTool::getFaces ( pConstTopologicalItem  item)
static

Returns the faces of the shape.

◆ getFacesAsCopy()

static std::vector<pFace> Topo::ShapeTool::getFacesAsCopy ( pConstTopologicalItem  item)
static

Returns the faces of the shape as Copy.

◆ getFacesByMaxNormalToVectorAngle()

static void Topo::ShapeTool::getFacesByMaxNormalToVectorAngle ( pConstShape  aShape,
std::map< int, Geom::Vec aDirectionsToSortBy,
std::map< int, std::vector< pConstFace > > &  aFacesListMap,
float  aMaxAngleRad = 0.75 
)
static

◆ getGeometricInformation()

static Topo::GeometricInformation Topo::ShapeTool::getGeometricInformation ( pConstTopologicalItem  item)
static

Returns geometric information about the item (like mass etc.)

◆ getIndexesFromFaces()

static std::vector<int> Topo::ShapeTool::getIndexesFromFaces ( pConstTopologicalItem  item,
const std::vector< pConstFace faces 
)
static

Returns the indexes of the faces in this shape. Returns -1 if face is not part of this shape.

◆ getIndexFromEdge()

static int Topo::ShapeTool::getIndexFromEdge ( pConstTopologicalItem  item,
pConstEdge  edge 
)
static

Returns the index of the edge in this shape. Returns -1 if edge is not part of this shape.

◆ getIndexFromFace()

static int Topo::ShapeTool::getIndexFromFace ( pConstTopologicalItem  item,
pConstFace  face 
)
static

Returns the index of the face in this shape. Returns -1 if face is not part of this shape.

◆ getIndexFromShell()

static int Topo::ShapeTool::getIndexFromShell ( pConstTopologicalItem  item,
pConstShell  shell 
)
static

Returns the index of the shell in this shape. Returns -1 if shell is not part of this shape.

◆ getIndexFromVertex() [1/2]

static int Topo::ShapeTool::getIndexFromVertex ( pConstTopologicalItem  item,
const Geom::Pnt v 
)
static

TODO -> This method is wrong since one gp_Pnt can correspond to more than one index.

◆ getIndexFromVertex() [2/2]

static int Topo::ShapeTool::getIndexFromVertex ( pConstTopologicalItem  item,
pConstVertex  vtx 
)
static

Return the index of vertex 'vtx'. Returns -1 if vertex is not part of this shape.

◆ getIndexFromWire()

static int Topo::ShapeTool::getIndexFromWire ( pConstTopologicalItem  item,
pConstWire  wire 
)
static

Returns the index of the wire in this shape. Returns -1 if wire is not part of this shape.

◆ getIntersectionPoints()

static std::vector<Geom::Pnt> Topo::ShapeTool::getIntersectionPoints ( pConstShape  shape,
const std::vector< pConstShape shapes 
)
static

◆ getLargestFaceArea()

static double Topo::ShapeTool::getLargestFaceArea ( pConstShape  shape)
static

◆ getLumpsCount()

static int Topo::ShapeTool::getLumpsCount ( pConstTopologicalItem  item)
static

Returns the number of lumps in the shape.

◆ getModelFromPolyHedral()

static bool Topo::ShapeTool::getModelFromPolyHedral ( pShape  shape,
std::vector< int > &  model,
std::vector< Geom::Pnt > &  vertices 
)
static

◆ getModelingTolerance()

static double Topo::ShapeTool::getModelingTolerance ( )
static

Returns the global resolution absolute.

◆ getPolygonCount()

static int Topo::ShapeTool::getPolygonCount ( pConstTopologicalItem  item,
Topo::ShapeTessellationQuality  quality 
)
static

Returns number of polygons in a shape.

◆ getShapeCount()

static size_t Topo::ShapeTool::getShapeCount ( )
static

◆ getShapesFromAcisFile()

static std::vector<pShape> Topo::ShapeTool::getShapesFromAcisFile ( const Base::String fileName,
double  scaleFactor = 1.,
std::function< int(int)>  callback = 0 
)
static

Reads in a SAT file and converts each ACIS BODY into a pShape.

◆ getShells()

static std::vector<pConstShell> Topo::ShapeTool::getShells ( pConstTopologicalItem  item)
static

Returns the shells of the shape.

◆ getThreadPool()

static Topo::ThreadPool* Topo::ShapeTool::getThreadPool ( )
static

◆ getTopoDS_Shape()

static bool Topo::ShapeTool::getTopoDS_Shape ( pConstTopologicalItem  shape,
TopoDS_Shape &  topoShape 
)
static

Gets the TopoDS_Shape of 'shape'. Returns 'true' on success, 'false' if shape has no TopoDS_Shape or the TopoDS_Shape is Null.

◆ getTransform()

static Geom::Trsf Topo::ShapeTool::getTransform ( pConstShape  shape)
static

Returns the transform of the shape.

◆ getVertexByIndex()

static pConstVertex Topo::ShapeTool::getVertexByIndex ( pConstTopologicalItem  item,
int  idx 
)
static

Returns the vertex at index 'idx'. Returns nullptr if index is out of bounds.

◆ getVertexCount()

static int Topo::ShapeTool::getVertexCount ( pConstTopologicalItem  item)
static

Returns the number of vertices in the shape.

◆ getVertexIndicesFromWire()

static std::vector<int> Topo::ShapeTool::getVertexIndicesFromWire ( pConstTopologicalItem  item,
int  wireIdx 
)
static

Returns sorted vertex indices of the wire with index 'wireIdx'.

◆ getVerticalAndHorizontalFaceAreas() [1/2]

static void Topo::ShapeTool::getVerticalAndHorizontalFaceAreas ( pConstShape  shape,
double &  verticalFaceSurface,
std::vector< double > &  verticalFaceSurfaces,
double &  verticalLargestFaceSurface,
double &  horizontalFaceSurface 
)
static

◆ getVerticalAndHorizontalFaceAreas() [2/2]

static void Topo::ShapeTool::getVerticalAndHorizontalFaceAreas ( pConstShape  shape,
Base::Double verticalFaceSurface,
std::vector< double > &  verticalFaceSurfaces,
Base::Double verticalLargestFaceSurface,
Base::Double horizontalFaceSurface 
)
static

Returns geometric information about the horizontal and vertical faces of the shape.

◆ getVertices()

static std::vector<pConstVertex> Topo::ShapeTool::getVertices ( pConstTopologicalItem  item)
static

Returns the vertices of the shape.

◆ getVerticesAsPoints()

static void Topo::ShapeTool::getVerticesAsPoints ( pConstTopologicalItem  item,
std::vector< Geom::Pnt > &  vertices 
)
static

Returns the vertices of a shape as a vector of points.

◆ getVolume()

static double Topo::ShapeTool::getVolume ( pConstTopologicalItem  item)
static

Returns the volume of a shape. Returns 0 if shape has no volume.

◆ getWireByIndex()

static pConstWire Topo::ShapeTool::getWireByIndex ( pConstTopologicalItem  item,
int  idx 
)
static

Returns the wire at index 'idx'. Returns nullptr if index is out of bounds.

◆ getWireCount()

static int Topo::ShapeTool::getWireCount ( pConstTopologicalItem  item)
static

Returns the number of wires in the shape.

◆ getWireIndicesFromFace()

static std::vector<int> Topo::ShapeTool::getWireIndicesFromFace ( pConstTopologicalItem  item,
int  faceIdx 
)
static

Returns wire indices of the face with index 'faceIdx'.

◆ getWires()

static std::vector<pConstWire> Topo::ShapeTool::getWires ( pConstTopologicalItem  item)
static

Returns the wires of the shape.

◆ getWriteFormat()

static std::string Topo::ShapeTool::getWriteFormat ( pConstShape  shape)
static

Returns the save format.

◆ hasFaces()

static bool Topo::ShapeTool::hasFaces ( pConstShape  shape,
bool &  allSubShapesHaveFaces 
)
static

Checks whether a shape consists of faces. In case of a compound the method will return true if ONE shape in the compound has a face. Also the flag 'allSubShapesHaveFaces' will be set depending on whether all of the sub-shapes have faces or not.

◆ hasNurbsFace()

static bool Topo::ShapeTool::hasNurbsFace ( pConstShape  shape)
static

Returns true if at least one of the shape's faces is NURBS face (see Topo::FaceTool::isNurbs())

◆ hasPolyHedral()

static bool Topo::ShapeTool::hasPolyHedral ( )
static

◆ hasSliverFaces()

static bool Topo::ShapeTool::hasSliverFaces ( pConstShape  shape)
static

◆ hasTriangulation()

static bool Topo::ShapeTool::hasTriangulation ( pConstShape  shape)
static

Checks if the shape has a triangulation ( = the shape is tessellated )

◆ hasVoids()

static bool Topo::ShapeTool::hasVoids ( pConstTopologicalItem  shape)
static

Checks if any of the faces in shape has voids.

◆ importBrep()

static pShape Topo::ShapeTool::importBrep ( Base::String  filename)
static

Read a Brep.

◆ imprint()

static bool Topo::ShapeTool::imprint ( pShape  base,
pShape  tool 
)
static

Intersects two shapes and imprints the intersection graph on BOTH shapes (if a closed loop of edges is created, a new face is made).

◆ intersectBBoxes()

static bool Topo::ShapeTool::intersectBBoxes ( pConstShape  shape1,
pConstShape  shape2 
)
static

◆ is_polyhedral_body()

static bool Topo::ShapeTool::is_polyhedral_body ( BODY const *  iBody)
static

◆ isClosedShell()

static bool Topo::ShapeTool::isClosedShell ( pConstShape  shape)
static

Checks if the shape is a closed shell.

◆ isClosedSolid()

static bool Topo::ShapeTool::isClosedSolid ( pConstShape  shape)
static

Checks if the shape is a closed solid.

◆ isCompound()

static bool Topo::ShapeTool::isCompound ( pConstShape  shape)
static

Checks if the shape consists of more than one sub-shape.

◆ isCylinder()

static bool Topo::ShapeTool::isCylinder ( pConstShape  shape,
Geom::Ax2 position,
double &  length,
double &  radius 
)
static

Checks if shape is a cylinder and returns the parameters.

◆ isEqual()

static bool Topo::ShapeTool::isEqual ( pConstTopologicalItem  shape1,
pConstTopologicalItem  shape2 
)
static

Checks if TopologicalItems are equal. Two items are equal if they have the same underlying pointer.

◆ isExtrudedAreaSolid()

static bool Topo::ShapeTool::isExtrudedAreaSolid ( pConstShape  aShape,
Geom::Ax2 aPosition,
double &  aLength,
pConstFace aProfile,
BuildingElementHintEnum  aHint = BuildingElementHintEnum::NO_HINT 
)
static

Checks if shape is an ExtrudedAreaSolid and returns the parameters.

◆ isFaceted()

static bool Topo::ShapeTool::isFaceted ( pConstTopologicalItem  shape)
static

Checks if the shape consists only of planar faces.

◆ isManifold()

static bool Topo::ShapeTool::isManifold ( pConstShape  shape)
static

◆ isMesh()

static bool Topo::ShapeTool::isMesh ( pConstShape  shape)
static

Checks if the shape is a mesh.

◆ isNull()

static bool Topo::ShapeTool::isNull ( pConstShape  shape)
static

Checks if the shape is Null.

◆ isOpenShell()

static bool Topo::ShapeTool::isOpenShell ( pConstShape  shape)
static

Checks if the shape is an open shell.

◆ isShell()

static bool Topo::ShapeTool::isShell ( pConstShape  shape)
static

Checks if the shape is an open or closed shell.

◆ isSingleEdge()

static pConstEdge Topo::ShapeTool::isSingleEdge ( pConstShape  shape)
static

Checks if the shape consists of one single wire with one edge and no faces. Returns the edge or nullptr.

◆ isSingleFace()

static pConstFace Topo::ShapeTool::isSingleFace ( pConstShape  shape)
static

Checks if the shape consists of one single face. Returns the face or nullptr.

◆ isSingleVertex()

static pConstVertex Topo::ShapeTool::isSingleVertex ( pConstShape  shape)
static

Checks if the shape consists of one wire with a single vertex but no edges or faces. Returns the vertex or nullptr.

◆ isSingleWire()

static pConstWire Topo::ShapeTool::isSingleWire ( pConstShape  shape)
static

Checks if the shape consists of one single wire and no faces. Returns the wire or nullptr.

◆ isValid() [1/5]

static bool Topo::ShapeTool::isValid ( pConstShape  shape,
int  checkLevel = 30 
)
static

Checks if the shape is valid. Check level can be between 10 (fast, but not profound) and 70 (slow and profound)

◆ isValid() [2/5]

static bool Topo::ShapeTool::isValid ( pConstWire  wire,
int  checkLevel = 30 
)
static

Checks if the shape is valid. Check level can be between 10 (fast, but not profound) and 70 (slow and profound)

◆ isValid() [3/5]

static bool Topo::ShapeTool::isValid ( pConstFace  face,
int  checkLevel = 30 
)
static

Checks if the shape is valid. Check level can be between 10 (fast, but not profound) and 70 (slow and profound)

◆ isValid() [4/5]

static bool Topo::ShapeTool::isValid ( pConstVertex  vertex,
int  checkLevel = 30 
)
static

Checks if the shape is valid. Check level can be between 10 (fast, but not profound) and 70 (slow and profound)

◆ isValid() [5/5]

static bool Topo::ShapeTool::isValid ( pConstEdge  edge,
int  checkLevel = 30 
)
static

Checks if the shape is valid. Check level can be between 10 (fast, but not profound) and 70 (slow and profound)

◆ isValidInCadwork3d()

static bool Topo::ShapeTool::isValidInCadwork3d ( pConstTopologicalItem  shape)
static

Checks if the shape is valid in cadwork3d. The checking level and type of checking are identical to the one in cadwork3d.

◆ isVertex()

static bool Topo::ShapeTool::isVertex ( pConstShape  shape)
static

Checks if the shape is a vertex.

◆ isWire()

static bool Topo::ShapeTool::isWire ( pConstShape  shape)
static

Checks if the shape is a wire.

◆ makeAcisShape()

static pShape Topo::ShapeTool::makeAcisShape ( pShape  input)
static

Make Acis-Shape.

◆ makeCompound()

static pShape Topo::ShapeTool::makeCompound ( const std::vector< pConstShape > &  shapes)
static

Makes a compound or combined shape from a vector of pShapes. The shapes are copied. The copies are not merged/united or tested for intersections. They may be unconnected.

◆ makeDbgElementFromShape()

static App::Element* Topo::ShapeTool::makeDbgElementFromShape ( Core::CoreDocument doc,
pConstShape  shape,
const Base::Color color = Base::Color(204, 204, 204) 
)
static

Returns a test element - for testing only!

◆ makeDbgSubElementFromShape()

static App::SubElement* Topo::ShapeTool::makeDbgSubElementFromShape ( Core::CoreDocument doc,
pConstShape  shape,
const Base::Color color = Base::Color(204, 204, 204) 
)
static

Returns a test element - for testing only!

◆ makeFaceSet() [1/2]

static pShape Topo::ShapeTool::makeFaceSet ( const std::vector< pFace > &  faces)
static

Makes a shape from a vector of pFaces. The faces are not stitched together and may be unconnected.

◆ makeFaceSet() [2/2]

static pShape Topo::ShapeTool::makeFaceSet ( pConstBrepData  data)
static

Makes a shape from BrepData. The faces are not stitched together and may be unconnected. No faces with voids are allowed!!!

◆ makeIndexedMesh() [1/2]

static pIndexedMesh Topo::ShapeTool::makeIndexedMesh ( pConstBrepData  data,
std::vector< PNTS > &  defectPolygons,
bool  createEdges = false 
)
static

Makes a indexed-Mesh from BrepData.

◆ makeIndexedMesh() [2/2]

static pIndexedMesh Topo::ShapeTool::makeIndexedMesh ( pConstShape  input,
bool  createEdges = false 
)
static

Makes a indexed-Mesh from shape.

◆ makeInventorMeshShape() [1/2]

static pShape Topo::ShapeTool::makeInventorMeshShape ( pIndexedMesh  )
static

Makes a mesh-shape from IndexedData.

◆ makeInventorMeshShape() [2/2]

static pShape Topo::ShapeTool::makeInventorMeshShape ( pConstBrepData  data,
std::vector< PNTS > &  defectPolygons 
)
static

Makes a mesh-shape from BrepData.

◆ makeLazyFacetedBrepShape()

static pShape Topo::ShapeTool::makeLazyFacetedBrepShape ( pConstBrepData  data,
std::vector< PNTS > &  defectPolygons 
)
static

Makes a shape from BrepData.

◆ makeOMFMeshShape()

static pShape Topo::ShapeTool::makeOMFMeshShape ( pConstBrepData  data,
std::vector< PNTS > &  defectPolygons 
)
static

Makes a mesh-shape from BrepData.

◆ makePolyHedral()

static pShape Topo::ShapeTool::makePolyHedral ( const std::vector< int > &  model,
const std::vector< Geom::Pnt > &  vertices,
bool  checkShape,
std::vector< std::vector< Geom::Pnt > > &  defectPolygons 
)
static

◆ makeShape() [1/10]

static pShape Topo::ShapeTool::makeShape ( pVertex  vertex)
static

Makes a shape from a single vertex.

◆ makeShape() [2/10]

static pShape Topo::ShapeTool::makeShape ( pEdge  edge)
static

Makes a shape from a single edge.

◆ makeShape() [3/10]

static pShape Topo::ShapeTool::makeShape ( pWire  wire,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Makes a shape from a single wire.

◆ makeShape() [4/10]

static pShape Topo::ShapeTool::makeShape ( pFace  face)
static

Makes a shape from a single face.

◆ makeShape() [5/10]

static pShape Topo::ShapeTool::makeShape ( pConstBrepData  data,
std::vector< PNTS > &  defectPolygons 
)
static

Makes a shape from BrepData.

◆ makeShape() [6/10]

static pShape Topo::ShapeTool::makeShape ( BODY *  aBody)
static

Makes a shape from Acis BODY.

◆ makeShape() [7/10]

static pShape Topo::ShapeTool::makeShape ( const std::vector< int > &  model,
const std::vector< Geom::Pnt > &  vertices,
std::vector< PNTS > &  defectPolygons 
)
static

Makes a shape from BrepData.

◆ makeShape() [8/10]

static pShape Topo::ShapeTool::makeShape ( const std::vector< Base::Int > &  model,
const std::vector< Geom::Pnt > &  vertices,
std::vector< PNTS > &  defectPolygons 
)
static

Makes a shape from BrepData.

◆ makeShape() [9/10]

static pShape Topo::ShapeTool::makeShape ( const std::vector< pFace > &  faces,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Makes an open or closed shape from a vector of pFaces. The faces are stitched or sewn together within given tolerance if possible. If stitch returns more than one body, this method returns compound shape from all resulted bodies.

◆ makeShape() [10/10]

static pShape Topo::ShapeTool::makeShape ( Core::DocObject curve,
double  startParam = 0,
double  endParam = 0 
)
static

Makes a shape from a curve. If the curve is bounded startParam and endParam can be omitted.

◆ makeShapeAsync() [1/2]

static void Topo::ShapeTool::makeShapeAsync ( pConstBrepData  data,
std::function< void(pShape newShape, std::vector< PNTS > defectPolygons)>  onShapeMadeCB 
)
static

Makes a shape from BrepData.

◆ makeShapeAsync() [2/2]

static void Topo::ShapeTool::makeShapeAsync ( const std::vector< int > &  model,
const std::vector< Geom::Pnt > &  vertices,
std::function< void(pShape newShape, std::vector< PNTS > defectPolygons)>  onShapeMadeCB 
)
static

Makes a shape from BrepData.

◆ makeShapes()

static bool Topo::ShapeTool::makeShapes ( const std::vector< pFace > &  faces,
std::vector< pShape > &  shapes,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Makes an open or closed shapes from a vector of pFaces. The faces are stitched or sewn together within given tolerance if possible.

◆ makeShapes_parallel()

static bool Topo::ShapeTool::makeShapes_parallel ( const std::vector< pConstBrepData > &  breps,
std::map< pConstBrepData, pShape > &  shapes 
)
static

Makes shapes from BrepData in parallel.

◆ mergePlanarFaces()

static pShape Topo::ShapeTool::mergePlanarFaces ( pConstShape  shape)
static

Returns a new shape where all planar faces of 'shape' are merged.

◆ mirrored()

static pShape Topo::ShapeTool::mirrored ( pConstShape  shape,
const Geom::Ax2 ax 
)
static

Returns a mirrored shape.

◆ offsetShape()

static pShape Topo::ShapeTool::offsetShape ( pConstShape  shape,
double  offset 
)
static

◆ rayPick()

static Topo::ToolOutcome Topo::ShapeTool::rayPick ( const std::vector< pConstTopologicalItem > &  targets,
const CA_Ray &  ray,
Topo::RayHitVector found 
)
static

Make a RayPick.

◆ read() [1/4]

static pShape Topo::ShapeTool::read ( const std::string &  format,
std::istream &  reader 
)
static

Reads a shape from istream in given format.

◆ read() [2/4]

static pShape Topo::ShapeTool::read ( const std::string &  format,
const std::string &  data,
float  version 
)
static

Reads shape in given format from data.

◆ read() [3/4]

static pShape Topo::ShapeTool::read ( const std::string &  format,
const std::string &  fileName 
)
static

Reads shape from fileName in given format.

◆ read() [4/4]

static pShape Topo::ShapeTool::read ( const std::string &  format,
const Base::String fileName 
)
static

Reads shape from fileName in given format.

◆ releaseCdwkSATAttributes()

static void Topo::ShapeTool::releaseCdwkSATAttributes ( pConstShape  shape)
static

Deletes the cadwork SAT attributes.

◆ removeAttribute()

static bool Topo::ShapeTool::removeAttribute ( pConstTopologicalItem  shape,
const Base::String name 
)
static

Remove Attribute from Shape.

◆ removedSliverFaces()

static pShape Topo::ShapeTool::removedSliverFaces ( pConstShape  shape,
double  aTolerance = -1 
)
static

◆ removeFaceting()

static void Topo::ShapeTool::removeFaceting ( pConstTopologicalItem  item)
static

Removes the faceting ( the triangle/mesh data ) associated with this item.

◆ restoreGlobalAttachment()

static bool Topo::ShapeTool::restoreGlobalAttachment ( Base::GlobalAttachment gAtta,
std::istream *  ,
uint64_t  streamsize,
const Base::String entryName 
)
static

◆ s_common()

static pShape Topo::ShapeTool::s_common ( pConstShape  base,
pConstShape  tool 
)
static

◆ s_cut()

static pShape Topo::ShapeTool::s_cut ( pConstShape  base,
pConstShape  tool 
)
static

◆ scaled()

static pShape Topo::ShapeTool::scaled ( pConstShape  base,
const Geom::XYZ scale 
)
static

Creates a copy of the shape and scales the copy. The scale can be non-uniform.

◆ section()

static pShape Topo::ShapeTool::section ( pConstShape  base,
pConstShape  tool,
bool *  ok = 0 
)
static

◆ setAttributeInteger()

static bool Topo::ShapeTool::setAttributeInteger ( pConstTopologicalItem  shape,
const Base::String name,
int  value 
)
static

Set Attribute to Shape.

◆ setAttributeString()

static bool Topo::ShapeTool::setAttributeString ( pConstTopologicalItem  shape,
const Base::String name,
const Base::String  
)
static

Set Attribute to Shape.

◆ setAttributeStringNonCopy()

static bool Topo::ShapeTool::setAttributeStringNonCopy ( pConstTopologicalItem  shape,
const Base::String name,
const Base::String  
)
static

Set Attribute to Shape, Don't copy attribute at Copy/Slip/Merge.

◆ setCdwkSATAttributes()

static bool Topo::ShapeTool::setCdwkSATAttributes ( pConstShape  shape,
const Topo::Cdwk_SAT_Attributes att 
)
static

Sets the cadwork SAT attributes.

◆ setEntityAttribute_Int()

static bool Topo::ShapeTool::setEntityAttribute_Int ( ENTITY *  ent,
int  v 
)
static

◆ setNeedMassUpdate()

static void Topo::ShapeTool::setNeedMassUpdate ( pConstShape  shape,
bool  on 
)
static

◆ shapeCountDec()

static void Topo::ShapeTool::shapeCountDec ( )
static

◆ shapeCountInc()

static void Topo::ShapeTool::shapeCountInc ( )
static

◆ simplifyShape()

static pShape Topo::ShapeTool::simplifyShape ( pConstShape  shape,
const SimplifyOptions opts 
)
static

◆ skinning()

static pShape Topo::ShapeTool::skinning ( Base::String errorInfo,
const Topo::SkinningOptions skinOptions,
const double &  precision = Geom::Precision::linear_Resolution() 
)
static

◆ splitByPlane()

static pShape Topo::ShapeTool::splitByPlane ( pConstShape  aBlank,
const Geom::Pln aPlane,
bool *  ok = 0 
)
static

◆ splitLumps()

static std::vector<pShape> Topo::ShapeTool::splitLumps ( pConstShape  shape)
static

◆ sweeping()

static pShape Topo::ShapeTool::sweeping ( Base::String errorInfo,
const Topo::SweepingOptions sweepOptions 
)
static

◆ thickenSheets()

static pShape Topo::ShapeTool::thickenSheets ( pConstShape  shape,
double  thickness,
bool  doubleSided = false,
Base::String errorInfo = Base::String() 
)
static

Thickens a shape consisting of sheets. If input shape is not a single sided sheet the function tries to convert it into one.

◆ transformed()

static pShape Topo::ShapeTool::transformed ( pConstShape  base,
const Geom::Trsf t 
)
static

Creates a copy of the shape and transforms the copy.

◆ transformShape2LocalSpaceOfElement()

static void Topo::ShapeTool::transformShape2LocalSpaceOfElement ( App::Element *  elem,
pShape  shape 
)
static

◆ triangulationToMesh()

static pMesh Topo::ShapeTool::triangulationToMesh ( pConstShape  shape)
static

Creates a mesh from the shape's triangulation. Returns nullptr if there is no triangulation. If the shape is a mesh returns a triangulated deep copy.

◆ write() [1/4]

static bool Topo::ShapeTool::write ( pConstShape  shape,
std::ostream &  writer 
)
static

Writes a shape to ostream.

◆ write() [2/4]

static bool Topo::ShapeTool::write ( pConstShape  shape,
Base::AbstractWriter writer 
)
static

Writes a shape to ostream.

◆ write() [3/4]

static bool Topo::ShapeTool::write ( const std::string &  format,
pConstShape  shape,
const Base::String fileName 
)
static

Writes the shape in the give format.

◆ write() [4/4]

static bool Topo::ShapeTool::write ( const std::string &  format,
std::vector< pConstShape shapes,
const Base::String fileName 
)
static

Writes the shapes in the give format.

◆ writeAcisFile()

static bool Topo::ShapeTool::writeAcisFile ( std::vector< pConstShape shapes,
const Base::String fileName,
bool  isText,
int  major_version = -1,
int  minor_version = -1,
double  scale = 1. 
)
static

Writes the shapes in an ACIS binary or text file. ACIS Attributes should be attached to the shape before exporting them. If 'major_version == -1' it takes the latest version.

Friends And Related Function Documentation

◆ MesherAcis::EdgeData_Acis

friend class MesherAcis::EdgeData_Acis
friend

◆ MesherAcis::facet_body_thread_worker

friend class MesherAcis::facet_body_thread_worker
friend

◆ MesherAcis::ShapeTesselator_Acis

friend class MesherAcis::ShapeTesselator_Acis
friend

◆ MesherAcis::TriangleData_Acis

friend class MesherAcis::TriangleData_Acis
friend

The documentation for this class was generated from the following file: