OCCT3D About OCCT
Open CASCADE Technology Reference Manual 8.0.1
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
BRepGraph_Transform Class Reference

Graph-to-graph transformation. More...

#include <BRepGraph_Transform.hxx>

Public Member Functions

 BRepGraph_Transform ()=delete
 

Static Public Member Functions

static bool Perform (const BRepGraph &theSourceGraph, BRepGraph &theTargetGraph, const gp_Trsf &theTrsf, const BRepGraph_Copy::GeomPolicy theGeomPolicy=BRepGraph_Copy::GeomPolicy::Copy, const BRepGraph_Copy::MeshPolicy theMeshPolicy=BRepGraph_Copy::MeshPolicy::Drop)
 Transform the entire graph into a target graph.
 
static BRepGraph_NodeId TransformNode (const BRepGraph &theSourceGraph, BRepGraph &theTargetGraph, const BRepGraph_NodeId theNodeId, const gp_Trsf &theTrsf, const BRepGraph_Copy::GeomPolicy theGeomPolicy=BRepGraph_Copy::GeomPolicy::Copy, const BRepGraph_Copy::MeshPolicy theMeshPolicy=BRepGraph_Copy::MeshPolicy::Drop)
 Transform a single node sub-graph of any kind. Topology nodes are copied and transformed by baking the transform into their definitions.
 
static bool MoveRef (BRepGraph &theGraph, const BRepGraph_ChildRefId theRefId, const gp_Trsf &theTrsf)
 Apply an in-place location-only transform to a child reference. Composes theTrsf into ChildRef placement without copying any geometry. 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.
 
static bool MoveRef (BRepGraph &theGraph, const BRepGraph_OccurrenceRefId theRefId, const gp_Trsf &theTrsf)
 Apply an in-place location-only transform to an occurrence reference. Composes theTrsf into OccurrenceRef placement without copying any geometry.
 

Detailed Description

Graph-to-graph transformation.

Applies a geometric transformation to vertex points and geometry node locations by copying into a target graph, then transforming in-place.

Two geometry modes (matching BRepBuilderAPI_Transform semantics):

Mesh handling (MeshPolicy parameter):

Note
Check the return value for success: Perform returns bool, TransformNode returns the mapped root NodeId (invalid on failure).

Typical usage

aGraph.Shapes().Add(myShape);
aTrsf.SetTranslation(gp_Vec(10.0, 0.0, 0.0));
TopoDS_Shape aShape = aTransformed.Shapes().Shape();
static bool Perform(const BRepGraph &theSourceGraph, BRepGraph &theTargetGraph, const gp_Trsf &theTrsf, const BRepGraph_Copy::GeomPolicy theGeomPolicy=BRepGraph_Copy::GeomPolicy::Copy, const BRepGraph_Copy::MeshPolicy theMeshPolicy=BRepGraph_Copy::MeshPolicy::Drop)
Transform the entire graph into a target graph.
Topology-geometry graph over TopoDS / BRep.
Definition BRepGraph.hxx:122
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

Constructor & Destructor Documentation

◆ BRepGraph_Transform()

BRepGraph_Transform::BRepGraph_Transform ( )
delete

Member Function Documentation

◆ MoveRef() [1/2]

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

Apply an in-place location-only transform to a child reference. Composes theTrsf into ChildRef placement without copying any geometry. 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 returns false if |scaleFactor| != 1.
Parameters
[in]theGraphthe graph containing the reference
[in]theRefIdchild reference to move
[in]theTrsfthe transformation to compose into the location
Returns
true on success; false if the ref is invalid/removed or theTrsf has non-unit scale

◆ MoveRef() [2/2]

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

Apply an in-place location-only transform to an occurrence reference. Composes theTrsf into OccurrenceRef placement without copying any geometry.

Note
Only pure rotation/translation transforms (scale == 1) are supported.
Returns
true on success; false if the ref is invalid/removed or theTrsf has non-unit scale

◆ Perform()

static bool BRepGraph_Transform::Perform ( const BRepGraph & theSourceGraph,
BRepGraph & theTargetGraph,
const gp_Trsf & theTrsf,
const BRepGraph_Copy::GeomPolicy theGeomPolicy = BRepGraph_Copy::GeomPolicy::Copy,
const BRepGraph_Copy::MeshPolicy theMeshPolicy = BRepGraph_Copy::MeshPolicy::Drop )
static

Transform the entire graph into a target graph.

Self-transform (theSourceGraph == theTargetGraph): Applies transform in-place on theTargetGraph.

External transform to empty target (theTargetGraph.IsEmpty()): Copies source into target, then transforms.

External transform to non-empty target: Appends source entities into target with explicit mapping, then transforms.

Parameters
[in]theSourceGrapha pre-built BRepGraph (must not be empty)
[in,out]theTargetGraphdestination graph (may already contain data)
[in]theTrsfthe transformation to apply
[in]theGeomPolicygeometry handle policy (default: Copy)
[in]theMeshPolicymesh data policy (default: Drop)
Returns
true on success, false on failure (empty source, or Drop + geometry-modification-required)

◆ TransformNode()

static BRepGraph_NodeId BRepGraph_Transform::TransformNode ( const BRepGraph & theSourceGraph,
BRepGraph & theTargetGraph,
const BRepGraph_NodeId theNodeId,
const gp_Trsf & theTrsf,
const BRepGraph_Copy::GeomPolicy theGeomPolicy = BRepGraph_Copy::GeomPolicy::Copy,
const BRepGraph_Copy::MeshPolicy theMeshPolicy = BRepGraph_Copy::MeshPolicy::Drop )
static

Transform a single node sub-graph of any kind. Topology nodes are copied and transformed by baking the transform into their definitions.

Self-transform (theSourceGraph == theTargetGraph): Duplicates the sub-graph with new entity IDs, then transforms the copy.

External transform: Copies the sub-graph into theTargetGraph, then transforms.

Parameters
[in]theSourceGrapha pre-built BRepGraph
[in,out]theTargetGraphdestination graph (may already contain data)
[in]theNodeIdnode identifier (any kind)
[in]theTrsfthe transformation to apply
[in]theGeomPolicygeometry handle policy (default: Copy; Drop is invalid for topology)
[in]theMeshPolicymesh data policy (default: Drop)
Returns
the mapped root NodeId in theTargetGraph, or invalid NodeId on failure

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