mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use triangleIndices instead of polygonIndices
This commit is contained in:
parent
41a103714e
commit
2ee25c6cf5
@ -57,7 +57,7 @@ public:
|
||||
private:
|
||||
void updatePartGeometry(caf::DisplayCoordTransform* displayCoordTransform);
|
||||
|
||||
static cvf::ref<cvf::DrawableGeo> createGeo(const std::vector<cvf::uint>& polygonIndices, const std::vector<cvf::Vec3f>& nodeCoords);
|
||||
static cvf::ref<cvf::DrawableGeo> createGeo(const std::vector<cvf::uint>& triangleIndices, const std::vector<cvf::Vec3f>& nodeCoords);
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimFracture> m_rimFracture;
|
||||
|
@ -119,14 +119,14 @@ void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEllipseFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* polygonIndices)
|
||||
void RimEllipseFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices)
|
||||
{
|
||||
RigEllipsisTesselator tesselator(20);
|
||||
|
||||
float a = halfLength;
|
||||
float b = height / 2.0f;
|
||||
|
||||
tesselator.tesselateEllipsis(a, b, polygonIndices, nodeCoords);
|
||||
tesselator.tesselateEllipsis(a, b, triangleIndices, nodeCoords);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -137,9 +137,9 @@ std::vector<cvf::Vec3f> RimEllipseFractureTemplate::fracturePolygon()
|
||||
std::vector<cvf::Vec3f> polygon;
|
||||
|
||||
std::vector<cvf::Vec3f> nodeCoords;
|
||||
std::vector<cvf::uint> polygonIndices;
|
||||
std::vector<cvf::uint> triangleIndices;
|
||||
|
||||
fractureGeometry(&nodeCoords, &polygonIndices);
|
||||
fractureGeometry(&nodeCoords, &triangleIndices);
|
||||
|
||||
for (size_t i = 1; i < nodeCoords.size(); i++)
|
||||
{
|
||||
|
@ -216,12 +216,12 @@ cvf::Vec3d RimFracture::fracturePosition() const
|
||||
void RimFracture::computeGeometry()
|
||||
{
|
||||
std::vector<cvf::Vec3f> nodeCoords;
|
||||
std::vector<cvf::uint> polygonIndices;
|
||||
std::vector<cvf::uint> triangleIndices;
|
||||
|
||||
RimFractureTemplate* fractureDef = attachedFractureDefinition();
|
||||
if (fractureDef )
|
||||
{
|
||||
fractureDef->fractureGeometry(&nodeCoords, &polygonIndices);
|
||||
fractureDef->fractureGeometry(&nodeCoords, &triangleIndices);
|
||||
}
|
||||
|
||||
cvf::Mat4f m = transformMatrix();
|
||||
@ -231,7 +231,7 @@ void RimFracture::computeGeometry()
|
||||
v.transformPoint(m);
|
||||
}
|
||||
|
||||
m_rigFracture->setGeometry(polygonIndices, nodeCoords);
|
||||
m_rigFracture->setGeometry(triangleIndices, nodeCoords);
|
||||
|
||||
m_recomputeGeometry = false;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
virtual void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* polygonIndices) = 0;
|
||||
virtual void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices) = 0;
|
||||
virtual std::vector<cvf::Vec3f> fracturePolygon() = 0;
|
||||
protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
|
@ -273,7 +273,7 @@ QString RimStimPlanFractureTemplate::getAttributeValueString(QXmlStreamReader &x
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* polygonIndices)
|
||||
void RimStimPlanFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
std::vector<double> getGriddingValues(QXmlStreamReader &xmlStream);
|
||||
std::vector<std::vector<double>> getAllDepthDataAtTimeStep(QXmlStreamReader &xmlStream);
|
||||
|
||||
void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* polygonIndices);
|
||||
void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices);
|
||||
std::vector<cvf::Vec3f> fracturePolygon();
|
||||
|
||||
protected:
|
||||
|
@ -36,10 +36,10 @@ RigFracture::RigFracture()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFracture::setGeometry(const std::vector<cvf::uint>& polygonIndices, const std::vector<cvf::Vec3f>& nodeCoords)
|
||||
void RigFracture::setGeometry(const std::vector<cvf::uint>& triangleIndices, const std::vector<cvf::Vec3f>& nodeCoords)
|
||||
{
|
||||
m_nodeCoords = nodeCoords;
|
||||
m_triangleIndices = polygonIndices;
|
||||
m_triangleIndices = triangleIndices;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -58,7 +58,7 @@ class RigFracture : public cvf::Object
|
||||
public:
|
||||
RigFracture();
|
||||
|
||||
void setGeometry(const std::vector<cvf::uint>& polygonIndices, const std::vector<cvf::Vec3f>& nodeCoords);
|
||||
void setGeometry(const std::vector<cvf::uint>& triangleIndices, const std::vector<cvf::Vec3f>& nodeCoords);
|
||||
|
||||
const std::vector<cvf::uint>& triangleIndices() const;
|
||||
const std::vector<cvf::Vec3f>& nodeCoords() const;
|
||||
|
@ -31,7 +31,7 @@ RigEllipsisTesselator::RigEllipsisTesselator(size_t numSlices)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEllipsisTesselator::tesselateEllipsis(float a, float b, std::vector<cvf::uint>* polygonIndices, std::vector<cvf::Vec3f>* nodeCoords)
|
||||
void RigEllipsisTesselator::tesselateEllipsis(float a, float b, std::vector<cvf::uint>* triangleIndices, std::vector<cvf::Vec3f>* nodeCoords)
|
||||
{
|
||||
// See http://mathworld.wolfram.com/Ellipse.html
|
||||
|
||||
@ -43,7 +43,7 @@ void RigEllipsisTesselator::tesselateEllipsis(float a, float b, std::vector<cvf:
|
||||
nodeCoords->push_back(v);
|
||||
}
|
||||
|
||||
*polygonIndices = m_circleConnectivities;
|
||||
*triangleIndices = m_circleConnectivities;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -32,7 +32,7 @@ class RigEllipsisTesselator
|
||||
public:
|
||||
RigEllipsisTesselator(size_t numSlices);
|
||||
|
||||
void tesselateEllipsis(float a, float b, std::vector<cvf::uint>* polygonIndices, std::vector<cvf::Vec3f>* nodeCoords);
|
||||
void tesselateEllipsis(float a, float b, std::vector<cvf::uint>* triangleIndices, std::vector<cvf::Vec3f>* nodeCoords);
|
||||
|
||||
private:
|
||||
void computeCirclePoints(size_t numSlices);
|
||||
|
Loading…
Reference in New Issue
Block a user