![]() |
Enzo
|
Attribute based geometry container exchanged and modified by nodes. More...
#include <Geometry.h>
Public Member Functions | |
Geometry (const Geometry &other) | |
Geometry & | operator= (const Geometry &rhs) |
Assignment operator. Performs a deep copy of another Geometry. | |
ga::AttributeHandle< bt::intT > | addIntAttribute (ga::AttributeOwner owner, std::string name) |
Adds an integer attribute to the geometry. | |
ga::AttributeHandleBool | addBoolAttribute (ga::AttributeOwner owner, std::string name) |
Adds a boolean attribute to the geometry. | |
ga::AttributeHandle< bt::Vector3 > | addVector3Attribute (ga::AttributeOwner owner, std::string name) |
Adds a 3D vector attribute to the geometry. | |
std::shared_ptr< ga::Attribute > | getAttribByName (ga::AttributeOwner owner, std::string name) |
Retrieves an attribute by its name. | |
const size_t | getNumAttributes (const ga::AttributeOwner owner) const |
Gets the number of attributes owned by a specific element type. | |
std::weak_ptr< const ga::Attribute > | getAttributeByIndex (ga::AttributeOwner owner, unsigned int index) const |
Retrieves an attribute by its index. | |
HeMesh | computeHalfEdgeMesh () |
Computes per-point normals for the geometry. | |
void | addFace (const std::vector< ga::Offset > &pointOffsets, bool closed=true) |
Adds a polygonal face to the geometry. | |
void | addPoint (const bt::Vector3 &pos) |
Adds a point to the geometry. | |
std::set< ga::Offset >::const_iterator | soloPointsBegin () |
Iterator to the beginning of the set of solo (isolated) points. | |
std::set< ga::Offset >::const_iterator | soloPointsEnd () |
Iterator to the end of the set of solo (isolated) points. | |
void | setPointPos (const ga::Offset offset, const bt::Vector3 &pos) |
Sets the position of a point. | |
ga::Offset | getPrimStartVertex (ga::Offset primOffset) const |
Gets the first vertex of a primitive. | |
bt::Vector3 | getPosFromVert (ga::Offset vertexOffset) const |
Gets the 3 dimensional position from a vertex offset. | |
bt::Vector3 | getPointPos (ga::Offset pointOffset) const |
Gets the position of a point. | |
unsigned int | getPrimVertCount (ga::Offset primOffset) const |
Gets the number of vertices in a primitive. | |
ga::Offset | getVertexPrim (ga::Offset vertexOffset) const |
Gets the primitive that owns a given vertex. | |
ga::Offset | getNumPrims () const |
Gets the number of primitives in the geometry. | |
ga::Offset | getNumVerts () const |
Gets the number of vertices in the geometry. | |
ga::Offset | getNumPoints () const |
Gets the number of points in the geometry. | |
ga::Offset | getNumSoloPoints () const |
Gets the number of isolated points in the geometry. Isolated points are points that are not connnected to any other point and don't belong to a primitive. | |
bt::boolT | isClosed (ga::Offset primOffset) const |
Checks if a primitive is closed or open. | |
void | merge (Geometry &other) |
Merges another geometry into this one. | |
void | computePrimStartVertices () const |
Computes the starting vertex for each primitive in the geometry. | |
Attribute based geometry container exchanged and modified by nodes.
The Geometry class represents the core data being passed between nodes in the engine. It is the operand of the network. Nodes read, modify, and output geometry, which is then used to populate the viewport and the geometry spreadsheet. Geometry is stored in an attribute based structure, similar to a spreadsheet, where each column is an attribute owned by points, vertices, primitives, or the global context. Most geometry information, including built in properties such as positions and connectivity, is stored through this same system. These built in attributes are intrinsic, but they share the same base as user-defined attributes to keep the data model consistent.
The class provides methods for constructing and querying geometry, including adding points and faces, computing normals, and building a CGAL half-edge mesh representation. It also exposes accessors for reading positions, primitive connectivity, and vertex data, while tracking special cases such as isolated points.
ga::AttributeHandleBool geo::Geometry::addBoolAttribute | ( | ga::AttributeOwner | owner, |
std::string | name ) |
Adds a boolean attribute to the geometry.
owner | The attribute owner (point, vertex, primitive, detail). |
name | The name of the attribute. |
void geo::Geometry::addFace | ( | const std::vector< ga::Offset > & | pointOffsets, |
bool | closed = true ) |
Adds a polygonal face to the geometry.
pointOffsets | Offsets of the points forming the face. |
closed | Whether the face is closed (default true). |
ga::AttributeHandleInt geo::Geometry::addIntAttribute | ( | ga::AttributeOwner | owner, |
std::string | name ) |
Adds an integer attribute to the geometry.
owner | The attribute owner (point, vertex, primitive, detail). |
name | The name of the attribute. |
void geo::Geometry::addPoint | ( | const bt::Vector3 & | pos | ) |
Adds a point to the geometry.
pos | Position of the new point. |
ga::AttributeHandle< bt::Vector3 > geo::Geometry::addVector3Attribute | ( | ga::AttributeOwner | owner, |
std::string | name ) |
Adds a 3D vector attribute to the geometry.
owner | The attribute owner (point, vertex, primitive, detail). |
name | The name of the attribute. |
enzo::geo::HeMesh geo::Geometry::computeHalfEdgeMesh | ( | ) |
Computes per-point normals for the geometry.
Builds a CGAL half-edge mesh representation of the geometry.
void geo::Geometry::computePrimStartVertices | ( | ) | const |
Computes the starting vertex for each primitive in the geometry.
std::shared_ptr< ga::Attribute > geo::Geometry::getAttribByName | ( | ga::AttributeOwner | owner, |
std::string | name ) |
Retrieves an attribute by its name.
owner | The attribute owner. |
name | The name of the attribute. |
std::weak_ptr< const ga::Attribute > geo::Geometry::getAttributeByIndex | ( | ga::AttributeOwner | owner, |
unsigned int | index ) const |
Retrieves an attribute by its index.
owner | The attribute owner. |
index | Index of the attribute. |
const size_t geo::Geometry::getNumAttributes | ( | const ga::AttributeOwner | owner | ) | const |
Gets the number of attributes owned by a specific element type.
owner | The attribute owner. |
ga::Offset geo::Geometry::getNumPoints | ( | ) | const |
Gets the number of points in the geometry.
ga::Offset geo::Geometry::getNumPrims | ( | ) | const |
Gets the number of primitives in the geometry.
ga::Offset geo::Geometry::getNumSoloPoints | ( | ) | const |
Gets the number of isolated points in the geometry. Isolated points are points that are not connnected to any other point and don't belong to a primitive.
ga::Offset geo::Geometry::getNumVerts | ( | ) | const |
Gets the number of vertices in the geometry.
bt::Vector3 geo::Geometry::getPointPos | ( | ga::Offset | pointOffset | ) | const |
Gets the position of a point.
pointOffset | Offset of the point. |
bt::Vector3 geo::Geometry::getPosFromVert | ( | ga::Offset | vertexOffset | ) | const |
Gets the 3 dimensional position from a vertex offset.
vertexOffset | Offset of the vertex. |
ga::Offset geo::Geometry::getPrimStartVertex | ( | ga::Offset | primOffset | ) | const |
Gets the first vertex of a primitive.
primOffset | Offset of the primitive. |
unsigned int geo::Geometry::getPrimVertCount | ( | ga::Offset | primOffset | ) | const |
Gets the number of vertices in a primitive.
primOffset | Offset of the primitive. |
ga::Offset geo::Geometry::getVertexPrim | ( | ga::Offset | vertexOffset | ) | const |
Gets the primitive that owns a given vertex.
vertexOffset | Offset of the vertex. |
bt::boolT geo::Geometry::isClosed | ( | ga::Offset | primOffset | ) | const |
Checks if a primitive is closed or open.
Open primitives are treated and rendered as curves.
primOffset | Offset of the primitive. |
void enzo::geo::Geometry::merge | ( | Geometry & | other | ) |
Merges another geometry into this one.
other | The geometry to merge. |
enzo::geo::Geometry & enzo::geo::Geometry::operator= | ( | const Geometry & | rhs | ) |
void geo::Geometry::setPointPos | ( | const ga::Offset | offset, |
const bt::Vector3 & | pos ) |
Sets the position of a point.
offset | Offset of the point. |
pos | New position. |
std::set< ga::Offset >::const_iterator geo::Geometry::soloPointsBegin | ( | ) |
Iterator to the beginning of the set of solo (isolated) points.
std::set< ga::Offset >::const_iterator geo::Geometry::soloPointsEnd | ( | ) |
Iterator to the end of the set of solo (isolated) points.