feat: only render solo points

This commit is contained in:
parker
2025-08-05 02:03:51 +01:00
parent 123f6d30fe
commit 2a0afc7c24
3 changed files with 41 additions and 9 deletions

View File

@@ -30,7 +30,10 @@ geo::Geometry::Geometry(const Geometry& other):
vertexCountHandlePrim_{enzo::ga::AttributeHandleInt(getAttribByName(ga::AttrOwner::PRIMITIVE, "vertexCount"))},
closedHandlePrim_{enzo::ga::AttributeHandleBool(getAttribByName(ga::AttrOwner::PRIMITIVE, "closed"))},
pointOffsetHandleVert_{enzo::ga::AttributeHandleInt(getAttribByName(ga::AttrOwner::VERTEX, "point"))},
posHandlePoint_{enzo::ga::AttributeHandleVector3(getAttribByName(ga::AttrOwner::POINT, "P"))}
posHandlePoint_{enzo::ga::AttributeHandleVector3(getAttribByName(ga::AttrOwner::POINT, "P"))},
// other
soloPoints_{other.soloPoints_}
{
}
@@ -40,6 +43,7 @@ void geo::Geometry::addFace(std::vector<ga::Offset> pointOffsets, bool closed)
for(ga::Offset pointOffset : pointOffsets)
{
pointOffsetHandleVert_.addValue(pointOffset);
soloPoints_.erase(pointOffset);
}
vertexCountHandlePrim_.addValue(pointOffsets.size());
closedHandlePrim_.addValue(closed);
@@ -49,10 +53,29 @@ void geo::Geometry::addFace(std::vector<ga::Offset> pointOffsets, bool closed)
void geo::Geometry::addPoint(const bt::Vector3& pos)
{
posHandlePoint_.addValue(pos);
soloPoints_.emplace(posHandlePoint_.getSize()-1);
}
ga::Offset geo::Geometry::getNumSoloPoints() const
{
return soloPoints_.size();
}
std::set<ga::Offset>::const_iterator geo::Geometry::soloPointsBegin()
{
return soloPoints_.begin();
}
std::set<ga::Offset>::const_iterator geo::Geometry::soloPointsEnd()
{
return soloPoints_.end();
}
bt::Vector3 geo::Geometry::getPosFromVert(ga::Offset vertexOffset) const
{
// get point offset

View File

@@ -34,6 +34,9 @@ public:
void addFace(std::vector<ga::Offset> pointOffsets, bool closed=true);
void addPoint(const bt::Vector3& pos);
std::set<ga::Offset>::const_iterator soloPointsBegin();
std::set<ga::Offset>::const_iterator soloPointsEnd();
void setPointPos(const ga::Offset offset, const bt::Vector3& pos);
ga::Offset getPrimStartVertex(ga::Offset primOffset) const; // returns the first vertex of the primitive
@@ -43,6 +46,7 @@ public:
ga::Offset getNumPrims() const;
ga::Offset getNumVerts() const;
ga::Offset getNumPoints() const;
ga::Offset getNumSoloPoints() const;
bt::boolT isClosed(ga::Offset primOffset) const;
@@ -58,6 +62,8 @@ private:
attribVector primitiveAttributes_;
attribVector globalAttributes_;
std::set<ga::Offset> soloPoints_;
std::vector<ga::Offset> primStarts_;
// handles