Graph-to-graph transformation.
More...
#include <BRepGraph_Transform.hxx>
|
| static BRepGraph | Perform (const BRepGraph &theGraph, const gp_Trsf &theTrsf, const bool theCopyGeom=true, const bool theCopyMesh=false) |
| | Transform the entire graph.
|
| |
| static BRepGraph | TransformNode (const BRepGraph &theGraph, const BRepGraph_NodeId theNodeId, const gp_Trsf &theTrsf, const bool theCopyGeom=true, const bool theCopyMesh=false) |
| | Transform a single node sub-graph of any kind (Face, Shell, Solid, Wire, Edge, Vertex). Produces a new BRepGraph containing only the specified node and its referenced sub-graph. The transform is applied to all copied geometry (same rules as Perform()).
|
| |
| static bool | MoveRef (BRepGraph &theGraph, const BRepGraph_RefId &theRefId, const gp_Trsf &theTrsf) |
| | Apply an in-place location-only transform to a single reference. Composes theTrsf into the reference's LocalLocation field without copying any geometry. This is O(1) and equivalent to TopoDS_Shape::Moved(trsf). Cached mesh data on entities downstream of the moved ref is stored in the entity's local frame and is unaffected; callers that bake a world transform into a cache key own the invalidation responsibility.
|
| |
Graph-to-graph transformation.
Produces a new BRepGraph by copying and then applying a geometric transformation to vertex points and geometry node locations.
Two geometry modes (matching BRepBuilderAPI_Transform semantics):
- theCopyGeom = true (geometry-level): deep-copy geometry, transform handles in-place via Geom_Surface::Transform() etc., reset locations to identity.
- theCopyGeom = false (root-level): light-copy with shared geometry, apply transform via location modification only.
Mesh handling (theCopyMesh parameter):
- theCopyMesh = false (default): triangulations and polygons are discarded after a geometry-level transform and must be recomputed.
- theCopyMesh = true: all mesh data (Poly_Triangulation on FaceDefs and the MeshLayer cache, Poly_Polygon3D on edges, Poly_PolygonOnTriangulation on coedges) is copied and transformed in sync with the geometry. In location-only mode the mesh data is copied as-is (nodes stay in the graph coordinate system, which is unaffected by a pure location compose).
- Note
- Returns BRepGraph directly (not a Result struct) because this is an immutable operation producing a new graph. Check IsDone() for success.
Typical usage
static Result Add(BRepGraph &theGraph, const TopoDS_Shape &theShape)
Ingest a TopoDS_Shape as a new root subgraph, wrapping the topology root in a Product.
Topology-geometry graph over TopoDS / BRep.
Definition BRepGraph.hxx:124
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142
Describes a shape which.
Definition TopoDS_Shape.hxx:41
Defines a non-persistent transformation in 3D space. The following transformations are implemented : ...
Definition gp_Trsf.hxx:59
Defines a non-persistent vector in 3D space.
Definition gp_Vec.hxx:30
◆ MoveRef()
Apply an in-place location-only transform to a single reference. Composes theTrsf into the reference's LocalLocation field without copying any geometry. This is O(1) and equivalent to TopoDS_Shape::Moved(trsf). Cached mesh data on entities downstream of the moved ref is stored in the entity's local frame and is unaffected; callers that bake a world transform into a cache key own the invalidation responsibility.
- Note
- Only pure rotation/translation transforms (scale == 1) are supported. The method is a no-op and returns false if |scaleFactor| != 1.
- Parameters
-
| [in] | theGraph | the graph containing the reference |
| [in] | theRefId | reference to move (any ref kind) |
| [in] | theTrsf | the transformation to compose into the location |
- Returns
- true on success; false if theTrsf has a non-unit scale factor
◆ Perform()
Transform the entire graph.
- Parameters
-
| [in] | theGraph | a pre-built BRepGraph (must have IsDone() == true) |
| [in] | theTrsf | the transformation to apply |
| [in] | theCopyGeom | if true, geometry is deep-copied before transforming; if false, light-copy then transform locations/points only |
| [in] | theCopyMesh | if true, mesh data (triangulations, polygons) is copied and transformed; if false, meshes are discarded after transform |
- Returns
- a new BRepGraph with the transformation applied
◆ TransformNode()
Transform a single node sub-graph of any kind (Face, Shell, Solid, Wire, Edge, Vertex). Produces a new BRepGraph containing only the specified node and its referenced sub-graph. The transform is applied to all copied geometry (same rules as Perform()).
- Parameters
-
| [in] | theGraph | a pre-built BRepGraph |
| [in] | theNodeId | node identifier (any kind: Face, Shell, Solid, Wire, Edge, Vertex, Compound, CompSolid, Product, Occurrence) |
| [in] | theTrsf | the transformation to apply |
| [in] | theCopyGeom | if true, geometry is deep-copied before transforming |
| [in] | theCopyMesh | if true, mesh data is copied and transformed |
- Returns
- a new BRepGraph containing only the specified sub-graph, transformed
The documentation for this class was generated from the following file: