Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Static Public Member Functions
BRepGraph_Transform Class Reference

Graph-to-graph transformation. More...

#include <BRepGraph_Transform.hxx>

Static Public Member Functions

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.
 

Detailed Description

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):

Mesh handling (theCopyMesh parameter):

Note
Returns BRepGraph directly (not a Result struct) because this is an immutable operation producing a new graph. Check IsDone() for success.

Typical usage

aTrsf.SetTranslation(gp_Vec(10.0, 0.0, 0.0));
TopoDS_Shape aShape = aTransformed.Shapes().Shape();
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.
static BRepGraph Perform(const BRepGraph &theGraph, const gp_Trsf &theTrsf, const bool theCopyGeom=true, const bool theCopyMesh=false)
Transform the entire graph.
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

Member Function Documentation

◆ MoveRef()

static bool BRepGraph_Transform::MoveRef ( BRepGraph & theGraph,
const BRepGraph_RefId & theRefId,
const gp_Trsf & theTrsf )
static

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]theGraphthe graph containing the reference
[in]theRefIdreference to move (any ref kind)
[in]theTrsfthe transformation to compose into the location
Returns
true on success; false if theTrsf has a non-unit scale factor

◆ Perform()

static BRepGraph BRepGraph_Transform::Perform ( const BRepGraph & theGraph,
const gp_Trsf & theTrsf,
const bool theCopyGeom = true,
const bool theCopyMesh = false )
static

Transform the entire graph.

Parameters
[in]theGrapha pre-built BRepGraph (must have IsDone() == true)
[in]theTrsfthe transformation to apply
[in]theCopyGeomif true, geometry is deep-copied before transforming; if false, light-copy then transform locations/points only
[in]theCopyMeshif 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()

static BRepGraph BRepGraph_Transform::TransformNode ( const BRepGraph & theGraph,
const BRepGraph_NodeId theNodeId,
const gp_Trsf & theTrsf,
const bool theCopyGeom = true,
const bool theCopyMesh = false )
static

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]theGrapha pre-built BRepGraph
[in]theNodeIdnode identifier (any kind: Face, Shell, Solid, Wire, Edge, Vertex, Compound, CompSolid, Product, Occurrence)
[in]theTrsfthe transformation to apply
[in]theCopyGeomif true, geometry is deep-copied before transforming
[in]theCopyMeshif 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: