+ removed unneeded pure virtual method getFaces from PropertyComplexGeoData
+ extend interface of ComplexGeoData::getPoints to also return normals if available
This commit is contained in:
@@ -293,12 +293,15 @@ private:
|
||||
if (shape && shape->getTypeId().isDerivedFrom(App::PropertyComplexGeoData::getClassTypeId())) {
|
||||
std::vector<Base::Vector3d> aPoints;
|
||||
std::vector<Data::ComplexGeoData::Facet> aTopo;
|
||||
static_cast<App::PropertyComplexGeoData*>(shape)->getFaces(aPoints, aTopo,fTolerance);
|
||||
mesh->addFacets(aTopo, aPoints);
|
||||
if (global_mesh.countFacets() == 0)
|
||||
global_mesh = *mesh;
|
||||
else
|
||||
global_mesh.addMesh(*mesh);
|
||||
const Data::ComplexGeoData* data = static_cast<App::PropertyComplexGeoData*>(shape)->getComplexData();
|
||||
if (data) {
|
||||
data->getFaces(aPoints, aTopo,fTolerance);
|
||||
mesh->addFacets(aTopo, aPoints);
|
||||
if (global_mesh.countFacets() == 0)
|
||||
global_mesh = *mesh;
|
||||
else
|
||||
global_mesh.addMesh(*mesh);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -253,6 +253,7 @@ MeshPoint MeshObject::getPoint(unsigned long index) const
|
||||
}
|
||||
|
||||
void MeshObject::getPoints(std::vector<Base::Vector3d> &Points,
|
||||
std::vector<Base::Vector3d> &Normals,
|
||||
float Accuracy, uint16_t flags) const
|
||||
{
|
||||
unsigned long ctpoints = _kernel.CountPoints();
|
||||
|
||||
@@ -129,6 +129,7 @@ public:
|
||||
double getVolume() const;
|
||||
/** Get points from object with given accuracy */
|
||||
virtual void getPoints(std::vector<Base::Vector3d> &Points,
|
||||
std::vector<Base::Vector3d> &Normals,
|
||||
float Accuracy, uint16_t flags=0) const;
|
||||
virtual void getFaces(std::vector<Base::Vector3d> &Points,std::vector<Facet> &Topo,
|
||||
float Accuracy, uint16_t flags=0) const;
|
||||
|
||||
@@ -502,13 +502,6 @@ Base::BoundBox3d PropertyMeshKernel::getBoundingBox() const
|
||||
return _meshObject->getBoundBox();
|
||||
}
|
||||
|
||||
void PropertyMeshKernel::getFaces(std::vector<Base::Vector3d> &aPoints,
|
||||
std::vector<Data::ComplexGeoData::Facet> &aTopo,
|
||||
float accuracy, uint16_t flags) const
|
||||
{
|
||||
_meshObject->getFaces(aPoints, aTopo, accuracy, flags);
|
||||
}
|
||||
|
||||
unsigned int PropertyMeshKernel::getMemSize (void) const
|
||||
{
|
||||
unsigned int size = 0;
|
||||
|
||||
@@ -207,10 +207,6 @@ public:
|
||||
const Data::ComplexGeoData* getComplexData() const;
|
||||
/** Returns the bounding box around the underlying mesh kernel */
|
||||
Base::BoundBox3d getBoundingBox() const;
|
||||
/** Get faces from object with given accuracy */
|
||||
virtual void getFaces(std::vector<Base::Vector3d> &Points,
|
||||
std::vector<Data::ComplexGeoData::Facet> &Topo,
|
||||
float Accuracy, uint16_t flags=0) const;
|
||||
//@}
|
||||
|
||||
/** @name Modification */
|
||||
|
||||
@@ -526,8 +526,11 @@ void CmdMeshFromGeometry::activated(int iMsg)
|
||||
if (jt->first == "Shape" && jt->second->getTypeId().isDerivedFrom(App::PropertyComplexGeoData::getClassTypeId())) {
|
||||
std::vector<Base::Vector3d> aPoints;
|
||||
std::vector<Data::ComplexGeoData::Facet> aTopo;
|
||||
static_cast<App::PropertyComplexGeoData*>(jt->second)->getFaces(aPoints, aTopo,(float)tol);
|
||||
mesh.setFacets(aTopo, aPoints);
|
||||
const Data::ComplexGeoData* data = static_cast<App::PropertyComplexGeoData*>(jt->second)->getComplexData();
|
||||
if (data) {
|
||||
data->getFaces(aPoints, aTopo,(float)tol);
|
||||
mesh.setFacets(aTopo, aPoints);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user