Points: translate doxygen from DE to EN + fix superfluous whitespace (#5287)
* Points: translate doxygen from DE to EN + fix superfluous whitespace For the purpose of making the source documentation uniform, source comments in this file were translated to english. * Points: remove superfluous whitespace * Fix left over DE to EN translations (from Cam and Mesh code)
This commit is contained in:
@@ -210,9 +210,9 @@ bool cutting_tools::getShapeBB()
|
|||||||
// dist = mesh.calc_edge_length(eh); //get the length of the current edge
|
// dist = mesh.calc_edge_length(eh); //get the length of the current edge
|
||||||
// if(dist>2.6) //Split the Edge now
|
// if(dist>2.6) //Split the Edge now
|
||||||
// {
|
// {
|
||||||
//
|
//
|
||||||
// //Get the Start and EndPoints of the Edge
|
// //Get the Start and EndPoints of the Edge
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// }
|
// }
|
||||||
@@ -221,7 +221,7 @@ bool cutting_tools::getShapeBB()
|
|||||||
//mesh.release(m_CAD_Mesh); //Function from MeshInterface to convert the Input Kernel back
|
//mesh.release(m_CAD_Mesh); //Function from MeshInterface to convert the Input Kernel back
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Here is the old OCC BoundingBox function
|
/* Here is the old OCC BoundingBox function
|
||||||
Bnd_Box currentBBox;
|
Bnd_Box currentBBox;
|
||||||
Standard_Real XMin, YMin, ZMin, XMax, YMax, ZMax;
|
Standard_Real XMin, YMin, ZMin, XMax, YMax, ZMax;
|
||||||
@@ -2337,7 +2337,7 @@ bool cutting_tools::OffsetWires_Spiral()
|
|||||||
}
|
}
|
||||||
else //We have to try a mesh intersection as the Nurb Intersection does not seem to work
|
else //We have to try a mesh intersection as the Nurb Intersection does not seem to work
|
||||||
{
|
{
|
||||||
cout << "Big Probleme";
|
cout << "Big Problem";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//Now get the Proper Normal at this point
|
//Now get the Proper Normal at this point
|
||||||
@@ -2640,7 +2640,7 @@ bool cutting_tools::OffsetWires_Spiral()
|
|||||||
}
|
}
|
||||||
else //We have to try a mesh intersection as the Nurb Intersection does not seem to work
|
else //We have to try a mesh intersection as the Nurb Intersection does not seem to work
|
||||||
{
|
{
|
||||||
cout << "Big Probleme";
|
cout << "Big Problem";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//Now get the Proper Normal at this point
|
//Now get the Proper Normal at this point
|
||||||
@@ -3492,7 +3492,7 @@ bool cutting_tools::classifyShape()
|
|||||||
m_pitch = fabs(maxlevel-minlevel)/cutnumber; //Correct m_pitch slightly to really get to the last level
|
m_pitch = fabs(maxlevel-minlevel)/cutnumber; //Correct m_pitch slightly to really get to the last level
|
||||||
|
|
||||||
//Currently, the last level of self-approximated surfaces is not considered as a path curve
|
//Currently, the last level of self-approximated surfaces is not considered as a path curve
|
||||||
//The first level is also completely omitted, since it is unimportant.
|
//The first level is also completely omitted, since it is unimportant.
|
||||||
//The track is only useful for the lower machine if there are still flat areas at all
|
//The track is only useful for the lower machine if there are still flat areas at all
|
||||||
for (int i=0;i<cutnumber;++i)
|
for (int i=0;i<cutnumber;++i)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,12 +50,12 @@ It provides members for all fields of the GUI settings window.
|
|||||||
struct CuttingToolsSettings
|
struct CuttingToolsSettings
|
||||||
{
|
{
|
||||||
/**This represents the maximum allowed angle for the springback functions*/
|
/**This represents the maximum allowed angle for the springback functions*/
|
||||||
float limit_angle;
|
float limit_angle;
|
||||||
/**This represents the minimum CAD-Radius of the forming shape. This is necessary for the springback
|
/**This represents the minimum CAD-Radius of the forming shape. This is necessary for the springback
|
||||||
to avoid the generation of radii which are below that value*/
|
to avoid the generation of radii which are below that value*/
|
||||||
float cad_radius;
|
float cad_radius;
|
||||||
/**This represents the radius of the Master Tool*/
|
/**This represents the radius of the Master Tool*/
|
||||||
float master_radius;
|
float master_radius;
|
||||||
/**This represents the radius of the Slave Tool*/
|
/**This represents the radius of the Slave Tool*/
|
||||||
float slave_radius;
|
float slave_radius;
|
||||||
/**This represents the cutting distance between two levels (the pitch)*/
|
/**This represents the cutting distance between two levels (the pitch)*/
|
||||||
@@ -74,9 +74,9 @@ struct CuttingToolsSettings
|
|||||||
float y_offset_robot;
|
float y_offset_robot;
|
||||||
/**This represents the X-Offset value for the robot output*/
|
/**This represents the X-Offset value for the robot output*/
|
||||||
float x_offset_robot;
|
float x_offset_robot;
|
||||||
/**This represents the error of the approximated NURB surface*/
|
/**This represents the error of the approximated NURB surface*/
|
||||||
float error_tolerance;
|
float error_tolerance;
|
||||||
|
|
||||||
/**This value is necessary to tell some special functions if we move zig/zag or clockwise/counterclockwise
|
/**This value is necessary to tell some special functions if we move zig/zag or clockwise/counterclockwise
|
||||||
without changing direction after each step*/
|
without changing direction after each step*/
|
||||||
bool clockwise;
|
bool clockwise;
|
||||||
@@ -114,26 +114,26 @@ struct Face_Less
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**\brief This class is the main class for the cutting Algorithms.
|
/**\brief This class is the main class for the cutting Algorithms.
|
||||||
|
|
||||||
Its idea is to provide the basic functionality for cutting CAD surfaces. In this class you can also find
|
Its idea is to provide the basic functionality for cutting CAD surfaces. In this class you can also find
|
||||||
functions useful for generating spiral and feature based toolpaths
|
functions useful for generating spiral and feature based toolpaths
|
||||||
*/
|
*/
|
||||||
class CamExport cutting_tools
|
class CamExport cutting_tools
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**\brief The standard constructor
|
/**\brief The standard constructor
|
||||||
|
|
||||||
\param aShape A TopoDS_Shape
|
\param aShape A TopoDS_Shape
|
||||||
*/
|
*/
|
||||||
cutting_tools(TopoDS_Shape aShape);
|
cutting_tools(TopoDS_Shape aShape);
|
||||||
|
|
||||||
/**\brief The second standard constructor
|
/**\brief The second standard constructor
|
||||||
|
|
||||||
This one gets a vertical step down value as well
|
This one gets a vertical step down value as well
|
||||||
\param aShape A TopoDS_Shape
|
\param aShape A TopoDS_Shape
|
||||||
\param pitch A vertical step down in[mm]
|
\param pitch A vertical step down in[mm]
|
||||||
*/
|
*/
|
||||||
cutting_tools(TopoDS_Shape aShape, float pitch);
|
cutting_tools(TopoDS_Shape aShape, float pitch);
|
||||||
|
|
||||||
/**\brief The standard destructor*/
|
/**\brief The standard destructor*/
|
||||||
@@ -151,7 +151,7 @@ public:
|
|||||||
the flat areas are inside
|
the flat areas are inside
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \brief Hier finden wir eine tolle Funktion */
|
/*! \brief Here we find a great function */
|
||||||
bool arrangecuts_ZLEVEL();
|
bool arrangecuts_ZLEVEL();
|
||||||
//bool checkPointIntersection(std::vector<projectPointContainer> &finalPoints);
|
//bool checkPointIntersection(std::vector<projectPointContainer> &finalPoints);
|
||||||
bool calculateAccurateSlaveZLevel(std::vector<std::pair<gp_Pnt,double> >&OffsetPoints, double current_z_level, double &slave_z_level, double &average_sheet_thickness,double &average_angle, bool &cutpos);
|
bool calculateAccurateSlaveZLevel(std::vector<std::pair<gp_Pnt,double> >&OffsetPoints, double current_z_level, double &slave_z_level, double &average_sheet_thickness,double &average_angle, bool &cutpos);
|
||||||
|
|||||||
@@ -1386,7 +1386,7 @@ Newtry: // If the generated path lengths are insufficient, a new attempt is star
|
|||||||
|
|
||||||
/*---Correction end---*/
|
/*---Correction end---*/
|
||||||
|
|
||||||
// Fülle Vektoren
|
// Full Vectors
|
||||||
l_vec.push_back(len); // Length
|
l_vec.push_back(len); // Length
|
||||||
v_vec.push_back(v); // Speeds
|
v_vec.push_back(v); // Speeds
|
||||||
a_vec.push_back(m_a); // Acceleration
|
a_vec.push_back(m_a); // Acceleration
|
||||||
@@ -1465,10 +1465,10 @@ Newtry: // If the generated path lengths are insufficient, a new attempt is star
|
|||||||
len_1 = (pow(v[1] - v[0],2.0) + pow(v[1],2.0))/m_a;
|
len_1 = (pow(v[1] - v[0],2.0) + pow(v[1],2.0))/m_a;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fülle Vektoren
|
// Full Vectors
|
||||||
l_vec.push_back(len); // Length
|
l_vec.push_back(len); // Length
|
||||||
v_vec.push_back(v); // Speeds
|
v_vec.push_back(v); // Speeds
|
||||||
a_vec.push_back(m_a); // Beschleunignung
|
a_vec.push_back(m_a); // Acceleration
|
||||||
|
|
||||||
// First fill the output vectors here (once per curve)
|
// First fill the output vectors here (once per curve)
|
||||||
if(tool)
|
if(tool)
|
||||||
|
|||||||
@@ -1078,39 +1078,39 @@ bool MeshEigensystem::Evaluate()
|
|||||||
|
|
||||||
const MeshPointArray& aclPoints = _rclMesh.GetPoints ();
|
const MeshPointArray& aclPoints = _rclMesh.GetPoints ();
|
||||||
for (MeshPointArray::_TConstIterator it = aclPoints.begin(); it!=aclPoints.end(); ++it) {
|
for (MeshPointArray::_TConstIterator it = aclPoints.begin(); it!=aclPoints.end(); ++it) {
|
||||||
// u-Richtung
|
// u-direction
|
||||||
clVect = *it - _cC;
|
clVect = *it - _cC;
|
||||||
clProj.ProjectToLine(clVect, _cU);
|
clProj.ProjectToLine(clVect, _cU);
|
||||||
clVect = clVect + clProj;
|
clVect = clVect + clProj;
|
||||||
fH = clVect.Length();
|
fH = clVect.Length();
|
||||||
|
|
||||||
// zeigen Vektoren in die gleiche Richtung ?
|
// point vectors in the same direction ?
|
||||||
if ((clVect * _cU) < 0.0f)
|
if ((clVect * _cU) < 0.0f)
|
||||||
fH = -fH;
|
fH = -fH;
|
||||||
|
|
||||||
xmax = std::max<float>(xmax, fH);
|
xmax = std::max<float>(xmax, fH);
|
||||||
xmin = std::min<float>(xmin, fH);
|
xmin = std::min<float>(xmin, fH);
|
||||||
|
|
||||||
// v-Richtung
|
// v-direction
|
||||||
clVect = *it - _cC;
|
clVect = *it - _cC;
|
||||||
clProj.ProjectToLine(clVect, _cV);
|
clProj.ProjectToLine(clVect, _cV);
|
||||||
clVect = clVect + clProj;
|
clVect = clVect + clProj;
|
||||||
fH = clVect.Length();
|
fH = clVect.Length();
|
||||||
|
|
||||||
// zeigen Vektoren in die gleiche Richtung ?
|
// point vectors in the same direction ?
|
||||||
if ((clVect * _cV) < 0.0f)
|
if ((clVect * _cV) < 0.0f)
|
||||||
fH = -fH;
|
fH = -fH;
|
||||||
|
|
||||||
ymax = std::max<float>(ymax, fH);
|
ymax = std::max<float>(ymax, fH);
|
||||||
ymin = std::min<float>(ymin, fH);
|
ymin = std::min<float>(ymin, fH);
|
||||||
|
|
||||||
// w-Richtung
|
// w-direction
|
||||||
clVect = *it - _cC;
|
clVect = *it - _cC;
|
||||||
clProj.ProjectToLine(clVect, _cW);
|
clProj.ProjectToLine(clVect, _cW);
|
||||||
clVect = clVect + clProj;
|
clVect = clVect + clProj;
|
||||||
fH = clVect.Length();
|
fH = clVect.Length();
|
||||||
|
|
||||||
// zeigen Vektoren in die gleiche Richtung ?
|
// point vectors in the same direction ?
|
||||||
if ((clVect * _cW) < 0.0f)
|
if ((clVect * _cW) < 0.0f)
|
||||||
fH = -fH;
|
fH = -fH;
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ PointKernel::size_type PointKernel::countValid(void) const
|
|||||||
{
|
{
|
||||||
size_type num = 0;
|
size_type num = 0;
|
||||||
for (const_point_iterator it = begin(); it != end(); ++it) {
|
for (const_point_iterator it = begin(); it != end(); ++it) {
|
||||||
if (!(boost::math::isnan(it->x) ||
|
if (!(boost::math::isnan(it->x) ||
|
||||||
boost::math::isnan(it->y) ||
|
boost::math::isnan(it->y) ||
|
||||||
boost::math::isnan(it->z)))
|
boost::math::isnan(it->z)))
|
||||||
num++;
|
num++;
|
||||||
@@ -153,7 +153,7 @@ std::vector<PointKernel::value_type> PointKernel::getValidPoints() const
|
|||||||
std::vector<PointKernel::value_type> valid;
|
std::vector<PointKernel::value_type> valid;
|
||||||
valid.reserve(countValid());
|
valid.reserve(countValid());
|
||||||
for (const_point_iterator it = begin(); it != end(); ++it) {
|
for (const_point_iterator it = begin(); it != end(); ++it) {
|
||||||
if (!(boost::math::isnan(it->x) ||
|
if (!(boost::math::isnan(it->x) ||
|
||||||
boost::math::isnan(it->y) ||
|
boost::math::isnan(it->y) ||
|
||||||
boost::math::isnan(it->z)))
|
boost::math::isnan(it->z)))
|
||||||
valid.emplace_back(
|
valid.emplace_back(
|
||||||
@@ -168,7 +168,7 @@ void PointKernel::Save (Base::Writer &writer) const
|
|||||||
{
|
{
|
||||||
if (!writer.isForceXML()) {
|
if (!writer.isForceXML()) {
|
||||||
writer.Stream() << writer.ind()
|
writer.Stream() << writer.ind()
|
||||||
<< "<Points file=\"" << writer.addFile(writer.ObjectName.c_str(), this) << "\" "
|
<< "<Points file=\"" << writer.addFile(writer.ObjectName.c_str(), this) << "\" "
|
||||||
<< "mtrx=\"" << _Mtrx.toString() << "\"/>" << std::endl;
|
<< "mtrx=\"" << _Mtrx.toString() << "\"/>" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,7 @@ void PointKernel::save(const char* file) const
|
|||||||
save(out);
|
save(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PointKernel::load(const char* file)
|
void PointKernel::load(const char* file)
|
||||||
{
|
{
|
||||||
PointsAlgos::Load(*this,file);
|
PointsAlgos::Load(*this,file);
|
||||||
}
|
}
|
||||||
@@ -267,7 +267,7 @@ PointKernel::const_point_iterator::const_point_iterator
|
|||||||
//{
|
//{
|
||||||
//}
|
//}
|
||||||
|
|
||||||
PointKernel::const_point_iterator&
|
PointKernel::const_point_iterator&
|
||||||
PointKernel::const_point_iterator::operator=(const PointKernel::const_point_iterator& pi)
|
PointKernel::const_point_iterator::operator=(const PointKernel::const_point_iterator& pi)
|
||||||
{
|
{
|
||||||
this->_kernel = pi._kernel;
|
this->_kernel = pi._kernel;
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ private:
|
|||||||
std::vector<value_type> _Points;
|
std::vector<value_type> _Points;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// number of points stored
|
/// number of points stored
|
||||||
size_type size(void) const {return this->_Points.size();}
|
size_type size(void) const {return this->_Points.size();}
|
||||||
size_type countValid(void) const;
|
size_type countValid(void) const;
|
||||||
std::vector<value_type> getValidPoints() const;
|
std::vector<value_type> getValidPoints() const;
|
||||||
@@ -195,4 +195,4 @@ public:
|
|||||||
} // namespace Points
|
} // namespace Points
|
||||||
|
|
||||||
|
|
||||||
#endif // POINTS_POINTPROPERTIES_H
|
#endif // POINTS_POINTPROPERTIES_H
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ protected:
|
|||||||
}
|
}
|
||||||
virtual pos_type seekoff(std::streambuf::off_type off,
|
virtual pos_type seekoff(std::streambuf::off_type off,
|
||||||
std::ios_base::seekdir way,
|
std::ios_base::seekdir way,
|
||||||
std::ios_base::openmode =
|
std::ios_base::openmode =
|
||||||
std::ios::in | std::ios::out) {
|
std::ios::in | std::ios::out) {
|
||||||
int p_pos=-1;
|
int p_pos=-1;
|
||||||
if (way == std::ios_base::beg)
|
if (way == std::ios_base::beg)
|
||||||
@@ -310,7 +310,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Taken from https://github.com/PointCloudLibrary/pcl/blob/master/io/src/lzf.cpp
|
//Taken from https://github.com/PointCloudLibrary/pcl/blob/master/io/src/lzf.cpp
|
||||||
unsigned int
|
unsigned int
|
||||||
lzfDecompress (const void *const in_data, unsigned int in_len,
|
lzfDecompress (const void *const in_data, unsigned int in_len,
|
||||||
void *out_data, unsigned int out_len)
|
void *out_data, unsigned int out_len)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -176,4 +176,4 @@ public:
|
|||||||
} // namespace Points
|
} // namespace Points
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ using namespace Points;
|
|||||||
|
|
||||||
PROPERTY_SOURCE(Points::Feature, App::GeoFeature)
|
PROPERTY_SOURCE(Points::Feature, App::GeoFeature)
|
||||||
|
|
||||||
Feature::Feature()
|
Feature::Feature()
|
||||||
{
|
{
|
||||||
ADD_PROPERTY(Points, (PointKernel()));
|
ADD_PROPERTY(Points, (PointKernel()));
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ void Feature::onChanged(const App::Property* prop)
|
|||||||
if (p != this->Placement.getValue())
|
if (p != this->Placement.getValue())
|
||||||
this->Placement.setValue(p);
|
this->Placement.setValue(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
GeoFeature::onChanged(prop);
|
GeoFeature::onChanged(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,4 +87,4 @@ typedef App::FeaturePythonT<Feature> FeaturePython;
|
|||||||
} //namespace Points
|
} //namespace Points
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ void PointsGrid::Attach (const PointKernel &rclM)
|
|||||||
void PointsGrid::Clear (void)
|
void PointsGrid::Clear (void)
|
||||||
{
|
{
|
||||||
_aulGrid.clear();
|
_aulGrid.clear();
|
||||||
_pclPoints = NULL;
|
_pclPoints = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PointsGrid::Rebuild (unsigned long ulX, unsigned long ulY, unsigned long ulZ)
|
void PointsGrid::Rebuild (unsigned long ulX, unsigned long ulY, unsigned long ulZ)
|
||||||
@@ -128,19 +128,19 @@ void PointsGrid::InitGrid (void)
|
|||||||
|
|
||||||
unsigned long i, j;
|
unsigned long i, j;
|
||||||
|
|
||||||
// Grid Laengen berechnen wenn nicht initialisiert
|
// Calculate grid lengths if not initialized
|
||||||
//
|
//
|
||||||
if ((_ulCtGridsX == 0) || (_ulCtGridsY == 0) || (_ulCtGridsZ == 0))
|
if ((_ulCtGridsX == 0) || (_ulCtGridsY == 0) || (_ulCtGridsZ == 0))
|
||||||
CalculateGridLength(POINTS_CT_GRID, POINTS_MAX_GRIDS);
|
CalculateGridLength(POINTS_CT_GRID, POINTS_MAX_GRIDS);
|
||||||
|
|
||||||
// Grid Laengen und Offset bestimmen
|
// Determine the grid length and offset
|
||||||
//
|
//
|
||||||
{
|
{
|
||||||
Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox();
|
Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox();
|
||||||
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
|
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
|
||||||
clBBPts.Add(*it);
|
clBBPts.Add(*it);
|
||||||
|
|
||||||
double fLengthX = clBBPts.LengthX();
|
double fLengthX = clBBPts.LengthX();
|
||||||
double fLengthY = clBBPts.LengthY();
|
double fLengthY = clBBPts.LengthY();
|
||||||
double fLengthZ = clBBPts.LengthZ();
|
double fLengthZ = clBBPts.LengthZ();
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ void PointsGrid::InitGrid (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Daten-Struktur anlegen
|
// Create data structure
|
||||||
_aulGrid.clear();
|
_aulGrid.clear();
|
||||||
_aulGrid.resize(_ulCtGridsX);
|
_aulGrid.resize(_ulCtGridsX);
|
||||||
for (i = 0; i < _ulCtGridsX; i++)
|
for (i = 0; i < _ulCtGridsX; i++)
|
||||||
@@ -176,10 +176,10 @@ void PointsGrid::InitGrid (void)
|
|||||||
unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::vector<unsigned long> &raulElements, bool bDelDoubles) const
|
unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::vector<unsigned long> &raulElements, bool bDelDoubles) const
|
||||||
{
|
{
|
||||||
unsigned long i, j, k, ulMinX, ulMinY, ulMinZ, ulMaxX, ulMaxY, ulMaxZ;
|
unsigned long i, j, k, ulMinX, ulMinY, ulMinZ, ulMaxX, ulMaxY, ulMaxZ;
|
||||||
|
|
||||||
raulElements.clear();
|
raulElements.clear();
|
||||||
|
|
||||||
// Grid-Boxen zur naehreren Auswahl
|
// Grid boxes for a more detailed selection
|
||||||
Position(Base::Vector3d(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
|
Position(Base::Vector3d(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
|
||||||
Position(Base::Vector3d(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
|
Position(Base::Vector3d(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
|
||||||
|
|
||||||
@@ -192,13 +192,13 @@ unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::vector<uns
|
|||||||
raulElements.insert(raulElements.end(), _aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
|
raulElements.insert(raulElements.end(), _aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bDelDoubles == true)
|
if (bDelDoubles == true)
|
||||||
{
|
{
|
||||||
// doppelte Nennungen entfernen
|
// remove duplicate mentions
|
||||||
std::sort(raulElements.begin(), raulElements.end());
|
std::sort(raulElements.begin(), raulElements.end());
|
||||||
raulElements.erase(std::unique(raulElements.begin(), raulElements.end()), raulElements.end());
|
raulElements.erase(std::unique(raulElements.begin(), raulElements.end()), raulElements.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
return raulElements.size();
|
return raulElements.size();
|
||||||
@@ -212,7 +212,7 @@ unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::vector<uns
|
|||||||
|
|
||||||
raulElements.clear();
|
raulElements.clear();
|
||||||
|
|
||||||
// Grid-Boxen zur naehreren Auswahl
|
// Grid boxes for a more detailed selection
|
||||||
Position(Base::Vector3d(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
|
Position(Base::Vector3d(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
|
||||||
Position(Base::Vector3d(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
|
Position(Base::Vector3d(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
|
||||||
|
|
||||||
@@ -226,13 +226,13 @@ unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::vector<uns
|
|||||||
raulElements.insert(raulElements.end(), _aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
|
raulElements.insert(raulElements.end(), _aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bDelDoubles == true)
|
if (bDelDoubles == true)
|
||||||
{
|
{
|
||||||
// doppelte Nennungen entfernen
|
// remove duplicate mentions
|
||||||
std::sort(raulElements.begin(), raulElements.end());
|
std::sort(raulElements.begin(), raulElements.end());
|
||||||
raulElements.erase(std::unique(raulElements.begin(), raulElements.end()), raulElements.end());
|
raulElements.erase(std::unique(raulElements.begin(), raulElements.end()), raulElements.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
return raulElements.size();
|
return raulElements.size();
|
||||||
@@ -241,10 +241,10 @@ unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::vector<uns
|
|||||||
unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::set<unsigned long> &raulElements) const
|
unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::set<unsigned long> &raulElements) const
|
||||||
{
|
{
|
||||||
unsigned long i, j, k, ulMinX, ulMinY, ulMinZ, ulMaxX, ulMaxY, ulMaxZ;
|
unsigned long i, j, k, ulMinX, ulMinY, ulMinZ, ulMaxX, ulMaxY, ulMaxZ;
|
||||||
|
|
||||||
raulElements.clear();
|
raulElements.clear();
|
||||||
|
|
||||||
// Grid-Boxen zur naehreren Auswahl
|
// Grid boxes for a more detailed selection
|
||||||
Position(Base::Vector3d(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
|
Position(Base::Vector3d(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
|
||||||
Position(Base::Vector3d(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
|
Position(Base::Vector3d(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
|
||||||
|
|
||||||
@@ -257,7 +257,7 @@ unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::set<unsign
|
|||||||
raulElements.insert(_aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
|
raulElements.insert(_aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return raulElements.size();
|
return raulElements.size();
|
||||||
}
|
}
|
||||||
@@ -282,9 +282,9 @@ void PointsGrid::Position (const Base::Vector3d &rclPoint, unsigned long &rulX,
|
|||||||
|
|
||||||
void PointsGrid::CalculateGridLength (unsigned long ulCtGrid, unsigned long ulMaxGrids)
|
void PointsGrid::CalculateGridLength (unsigned long ulCtGrid, unsigned long ulMaxGrids)
|
||||||
{
|
{
|
||||||
// Grid Laengen bzw. Anzahl der Grids pro Dimension berechnen
|
// Calculate grid lengths or number of grids per dimension
|
||||||
// pro Grid sollen ca. 10 (?!?!) Facets liegen
|
// There should be about 10 (?!?!) facets per grid
|
||||||
// bzw. max Grids sollten 10000 nicht ueberschreiten
|
// or max grids should not exceed 10000
|
||||||
Base::BoundBox3d clBBPtsEnlarged;// = _pclPoints->GetBoundBox();
|
Base::BoundBox3d clBBPtsEnlarged;// = _pclPoints->GetBoundBox();
|
||||||
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
|
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
|
||||||
clBBPtsEnlarged.Add(*it);
|
clBBPtsEnlarged.Add(*it);
|
||||||
@@ -319,9 +319,9 @@ void PointsGrid::CalculateGridLength (int iCtGridPerAxis)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Grid Laengen bzw. Anzahl der Grids pro Dimension berechnen
|
// Calculate grid lengths or number of grids per dimension
|
||||||
// pro Grid sollen ca. 10 (?!?!) Facets liegen
|
// There should be about 10 (?!?!) facets per grid
|
||||||
// bzw. max Grids sollten 10000 nicht ueberschreiten
|
// or max grids should not exceed 10000
|
||||||
Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox();
|
Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox();
|
||||||
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
|
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
|
||||||
clBBPts.Add(*it);
|
clBBPts.Add(*it);
|
||||||
@@ -342,21 +342,21 @@ void PointsGrid::CalculateGridLength (int iCtGridPerAxis)
|
|||||||
|
|
||||||
int iMaxGrids = 1;
|
int iMaxGrids = 1;
|
||||||
|
|
||||||
if (bLenghtXisZero)
|
if (bLenghtXisZero)
|
||||||
iFlag += 1;
|
iFlag += 1;
|
||||||
else
|
else
|
||||||
iMaxGrids *= iCtGridPerAxis;
|
iMaxGrids *= iCtGridPerAxis;
|
||||||
|
|
||||||
if (bLenghtYisZero)
|
if (bLenghtYisZero)
|
||||||
iFlag += 2;
|
iFlag += 2;
|
||||||
else
|
else
|
||||||
iMaxGrids *= iCtGridPerAxis;
|
iMaxGrids *= iCtGridPerAxis;
|
||||||
|
|
||||||
if (bLenghtZisZero)
|
if (bLenghtZisZero)
|
||||||
iFlag += 4;
|
iFlag += 4;
|
||||||
else
|
else
|
||||||
iMaxGrids *= iCtGridPerAxis;
|
iMaxGrids *= iCtGridPerAxis;
|
||||||
|
|
||||||
unsigned long ulGridsFacets = 10;
|
unsigned long ulGridsFacets = 10;
|
||||||
|
|
||||||
double fFactorVolumen = 40.0;
|
double fFactorVolumen = 40.0;
|
||||||
@@ -378,12 +378,12 @@ void PointsGrid::CalculateGridLength (int iCtGridPerAxis)
|
|||||||
_ulCtGridsX = std::max<unsigned long>((unsigned long)(fLenghtX / fLengthGrid), 1);
|
_ulCtGridsX = std::max<unsigned long>((unsigned long)(fLenghtX / fLengthGrid), 1);
|
||||||
_ulCtGridsY = std::max<unsigned long>((unsigned long)(fLenghtY / fLengthGrid), 1);
|
_ulCtGridsY = std::max<unsigned long>((unsigned long)(fLenghtY / fLengthGrid), 1);
|
||||||
_ulCtGridsZ = std::max<unsigned long>((unsigned long)(fLenghtZ / fLengthGrid), 1);
|
_ulCtGridsZ = std::max<unsigned long>((unsigned long)(fLenghtZ / fLengthGrid), 1);
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
_ulCtGridsX = 1; // bLenghtXisZero
|
_ulCtGridsX = 1; // bLenghtXisZero
|
||||||
|
|
||||||
double fArea = fLenghtY * fLenghtZ;
|
double fArea = fLenghtY * fLenghtZ;
|
||||||
|
|
||||||
double fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
|
double fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
|
||||||
@@ -399,7 +399,7 @@ void PointsGrid::CalculateGridLength (int iCtGridPerAxis)
|
|||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
_ulCtGridsY = 1; // bLenghtYisZero
|
_ulCtGridsY = 1; // bLenghtYisZero
|
||||||
|
|
||||||
double fArea = fLenghtX * fLenghtZ;
|
double fArea = fLenghtX * fLenghtZ;
|
||||||
|
|
||||||
double fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
|
double fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
|
||||||
@@ -421,7 +421,7 @@ void PointsGrid::CalculateGridLength (int iCtGridPerAxis)
|
|||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
_ulCtGridsZ = 1; // bLenghtZisZero
|
_ulCtGridsZ = 1; // bLenghtZisZero
|
||||||
|
|
||||||
double fArea = fLenghtX * fLenghtY;
|
double fArea = fLenghtX * fLenghtY;
|
||||||
|
|
||||||
double fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
|
double fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
|
||||||
@@ -461,7 +461,7 @@ void PointsGrid::SearchNearestFromPoint (const Base::Vector3d &rclPt, std::set<u
|
|||||||
Base::BoundBox3d clBB = GetBoundBox();
|
Base::BoundBox3d clBB = GetBoundBox();
|
||||||
|
|
||||||
if (clBB.IsInBox(rclPt) == true)
|
if (clBB.IsInBox(rclPt) == true)
|
||||||
{ // Punkt liegt innerhalb
|
{ // Point lies within
|
||||||
unsigned long ulX, ulY, ulZ;
|
unsigned long ulX, ulY, ulZ;
|
||||||
Position(rclPt, ulX, ulY, ulZ);
|
Position(rclPt, ulX, ulY, ulZ);
|
||||||
//int nX = ulX, nY = ulY, nZ = ulZ;
|
//int nX = ulX, nY = ulY, nZ = ulZ;
|
||||||
@@ -471,7 +471,7 @@ void PointsGrid::SearchNearestFromPoint (const Base::Vector3d &rclPt, std::set<u
|
|||||||
GetHull(ulX, ulY, ulZ, ulLevel, raclInd);
|
GetHull(ulX, ulY, ulZ, ulLevel, raclInd);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Punkt ausserhalb
|
{ // Point outside
|
||||||
Base::BoundBox3d::SIDE tSide = clBB.GetSideFromRay(rclPt, clBB.GetCenter() - rclPt);
|
Base::BoundBox3d::SIDE tSide = clBB.GetSideFromRay(rclPt, clBB.GetCenter() - rclPt);
|
||||||
switch (tSide)
|
switch (tSide)
|
||||||
{
|
{
|
||||||
@@ -566,7 +566,7 @@ void PointsGrid::SearchNearestFromPoint (const Base::Vector3d &rclPt, std::set<u
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PointsGrid::GetHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
|
void PointsGrid::GetHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
|
||||||
unsigned long ulDistance, std::set<unsigned long> &raclInd) const
|
unsigned long ulDistance, std::set<unsigned long> &raclInd) const
|
||||||
{
|
{
|
||||||
int nX1 = std::max<int>(0, int(ulX) - int(ulDistance));
|
int nX1 = std::max<int>(0, int(ulX) - int(ulDistance));
|
||||||
@@ -616,7 +616,7 @@ void PointsGrid::GetHull (unsigned long ulX, unsigned long ulY, unsigned long ul
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long PointsGrid::GetElements (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
|
unsigned long PointsGrid::GetElements (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
|
||||||
std::set<unsigned long> &raclInd) const
|
std::set<unsigned long> &raclInd) const
|
||||||
{
|
{
|
||||||
const std::set<unsigned long> &rclSet = _aulGrid[ulX][ulY][ulZ];
|
const std::set<unsigned long> &rclSet = _aulGrid[ulX][ulY][ulZ];
|
||||||
@@ -656,7 +656,7 @@ void PointsGrid::Validate (void)
|
|||||||
|
|
||||||
bool PointsGrid::Verify() const
|
bool PointsGrid::Verify() const
|
||||||
{
|
{
|
||||||
if ( !_pclPoints )
|
if ( !_pclPoints )
|
||||||
return false; // no point cloud attached
|
return false; // no point cloud attached
|
||||||
if (_pclPoints->size() != _ulCtElements)
|
if (_pclPoints->size() != _ulCtElements)
|
||||||
return false; // not up-to-date
|
return false; // not up-to-date
|
||||||
@@ -682,8 +682,8 @@ void PointsGrid::RebuildGrid (void)
|
|||||||
_ulCtElements = _pclPoints->size();
|
_ulCtElements = _pclPoints->size();
|
||||||
|
|
||||||
InitGrid();
|
InitGrid();
|
||||||
|
|
||||||
// Daten-Struktur fuellen
|
// Fill data structure
|
||||||
|
|
||||||
unsigned long i = 0;
|
unsigned long i = 0;
|
||||||
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
|
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
|
||||||
@@ -741,24 +741,24 @@ bool PointsGridIterator::InitOnRay (const Base::Vector3d &rclPt, const Base::Vec
|
|||||||
|
|
||||||
_fMaxSearchArea = FLOAT_MAX;
|
_fMaxSearchArea = FLOAT_MAX;
|
||||||
|
|
||||||
raulElements.clear();
|
raulElements.clear();
|
||||||
|
|
||||||
_clPt = rclPt;
|
_clPt = rclPt;
|
||||||
_clDir = rclDir;
|
_clDir = rclDir;
|
||||||
_bValidRay = false;
|
_bValidRay = false;
|
||||||
|
|
||||||
// liegt Punkt innerhalb globalen BB
|
// point lies within global BB
|
||||||
if ((_rclGrid.GetBoundBox().IsInBox(rclPt)) == true)
|
if ((_rclGrid.GetBoundBox().IsInBox(rclPt)) == true)
|
||||||
{ // Voxel bestimmen, indem der Startpunkt liegt
|
{ // determine the voxel by the starting point
|
||||||
_rclGrid.Position(rclPt, _ulX, _ulY, _ulZ);
|
_rclGrid.Position(rclPt, _ulX, _ulY, _ulZ);
|
||||||
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
|
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
|
||||||
_bValidRay = true;
|
_bValidRay = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Startpunkt ausserhalb
|
{ // StartPoint outside
|
||||||
Base::Vector3d cP0, cP1;
|
Base::Vector3d cP0, cP1;
|
||||||
if (_rclGrid.GetBoundBox().IntersectWithLine(rclPt, rclDir, cP0, cP1) == true)
|
if (_rclGrid.GetBoundBox().IntersectWithLine(rclPt, rclDir, cP0, cP1) == true)
|
||||||
{ // naechsten Punkt bestimmen
|
{ // determine the next point
|
||||||
if ((cP0 - rclPt).Length() < (cP1 - rclPt).Length())
|
if ((cP0 - rclPt).Length() < (cP1 - rclPt).Length())
|
||||||
_rclGrid.Position(cP0, _ulX, _ulY, _ulZ);
|
_rclGrid.Position(cP0, _ulX, _ulY, _ulZ);
|
||||||
else
|
else
|
||||||
@@ -775,16 +775,16 @@ bool PointsGridIterator::InitOnRay (const Base::Vector3d &rclPt, const Base::Vec
|
|||||||
bool PointsGridIterator::NextOnRay (std::vector<unsigned long> &raulElements)
|
bool PointsGridIterator::NextOnRay (std::vector<unsigned long> &raulElements)
|
||||||
{
|
{
|
||||||
if (_bValidRay == false)
|
if (_bValidRay == false)
|
||||||
return false; // nicht initialisiert oder Strahl ausgetreten
|
return false; // not initialized or beam exited
|
||||||
|
|
||||||
raulElements.clear();
|
raulElements.clear();
|
||||||
|
|
||||||
Base::Vector3d clIntersectPoint;
|
Base::Vector3d clIntersectPoint;
|
||||||
|
|
||||||
// naechstes anliegende BB auf dem Suchstrahl suchen
|
// Look for the next adjacent BB on the search beam
|
||||||
Base::BoundBox3d::SIDE tSide = _rclGrid.GetBoundBox(_ulX, _ulY, _ulZ).GetSideFromRay(_clPt, _clDir, clIntersectPoint);
|
Base::BoundBox3d::SIDE tSide = _rclGrid.GetBoundBox(_ulX, _ulY, _ulZ).GetSideFromRay(_clPt, _clDir, clIntersectPoint);
|
||||||
|
|
||||||
// Suchbereich
|
// Search area
|
||||||
//
|
//
|
||||||
if ((_clPt-clIntersectPoint).Length() > _fMaxSearchArea)
|
if ((_clPt-clIntersectPoint).Length() > _fMaxSearchArea)
|
||||||
{
|
{
|
||||||
@@ -815,10 +815,10 @@ bool PointsGridIterator::NextOnRay (std::vector<unsigned long> &raulElements)
|
|||||||
if ((_bValidRay == true) && (_rclGrid.CheckPos(_ulX, _ulY, _ulZ) == true))
|
if ((_bValidRay == true) && (_rclGrid.CheckPos(_ulX, _ulY, _ulZ) == true))
|
||||||
{
|
{
|
||||||
GridElement pos(_ulX, _ulY, _ulZ); _cSearchPositions.insert(pos);
|
GridElement pos(_ulX, _ulY, _ulZ); _cSearchPositions.insert(pos);
|
||||||
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
|
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_bValidRay = false; // Strahl ausgetreten
|
_bValidRay = false; // Beam escaped
|
||||||
|
|
||||||
return _bValidRay;
|
return _bValidRay;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace Points {
|
|||||||
class PointsGrid;
|
class PointsGrid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The PointsGrid allows to divide a global point cloud into smaller regions of elements depending on the resolution of the grid.
|
* The PointsGrid allows to divide a global point cloud into smaller regions of elements depending on the resolution of the grid.
|
||||||
* All grid elements in the grid structure have the same size.
|
* All grid elements in the grid structure have the same size.
|
||||||
*
|
*
|
||||||
* Grids can be used within algorithms to avoid to iterate through all elements, so grids can speed up algorithms dramatically.
|
* Grids can be used within algorithms to avoid to iterate through all elements, so grids can speed up algorithms dramatically.
|
||||||
@@ -66,7 +66,7 @@ public:
|
|||||||
//@}
|
//@}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Attaches the point kernel to this grid, an already attached point cloud gets detached. The grid gets rebuilt
|
/** Attaches the point kernel to this grid, an already attached point cloud gets detached. The grid gets rebuilt
|
||||||
* automatically. */
|
* automatically. */
|
||||||
virtual void Attach (const PointKernel &rclM);
|
virtual void Attach (const PointKernel &rclM);
|
||||||
/** Rebuilds the grid structure. */
|
/** Rebuilds the grid structure. */
|
||||||
@@ -114,7 +114,7 @@ public:
|
|||||||
virtual void Validate (void);
|
virtual void Validate (void);
|
||||||
/** Verifies the grid structure and returns false if inconsistencies are found. */
|
/** Verifies the grid structure and returns false if inconsistencies are found. */
|
||||||
virtual bool Verify() const;
|
virtual bool Verify() const;
|
||||||
/** Returns the indices of the grid this point lies in. If the point is outside the grid then the indices of
|
/** Returns the indices of the grid this point lies in. If the point is outside the grid then the indices of
|
||||||
* the nearest grid element are taken.*/
|
* the nearest grid element are taken.*/
|
||||||
virtual void Position (const Base::Vector3d &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const;
|
virtual void Position (const Base::Vector3d &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const;
|
||||||
/** Returns the indices of the elements in the given grid. */
|
/** Returns the indices of the elements in the given grid. */
|
||||||
@@ -150,7 +150,7 @@ protected:
|
|||||||
double _fGridLenY; /**< Length of grid elements in y. */
|
double _fGridLenY; /**< Length of grid elements in y. */
|
||||||
double _fGridLenZ; /**< Length of grid elements in z. */
|
double _fGridLenZ; /**< Length of grid elements in z. */
|
||||||
double _fMinX; /**< Grid null position in x. */
|
double _fMinX; /**< Grid null position in x. */
|
||||||
double _fMinY; /**< Grid null position in y. */
|
double _fMinY; /**< Grid null position in y. */
|
||||||
double _fMinZ; /**< Grid null position in z. */
|
double _fMinZ; /**< Grid null position in z. */
|
||||||
|
|
||||||
// friends
|
// friends
|
||||||
@@ -160,7 +160,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** Adds a new point element to the grid structure. \a rclPt is the geometric point and \a ulPtIndex
|
/** Adds a new point element to the grid structure. \a rclPt is the geometric point and \a ulPtIndex
|
||||||
* the corresponding index in the point kernel. */
|
* the corresponding index in the point kernel. */
|
||||||
void AddPoint (const Base::Vector3d &rclPt, unsigned long ulPtIndex, float fEpsilon = 0.0f);
|
void AddPoint (const Base::Vector3d &rclPt, unsigned long ulPtIndex, float fEpsilon = 0.0f);
|
||||||
/** Returns the grid numbers to the given point \a rclPoint. */
|
/** Returns the grid numbers to the given point \a rclPoint. */
|
||||||
@@ -189,7 +189,7 @@ public:
|
|||||||
/** Sets the iterator to the first element*/
|
/** Sets the iterator to the first element*/
|
||||||
void Init (void)
|
void Init (void)
|
||||||
{ _ulX = _ulY = _ulZ = 0; }
|
{ _ulX = _ulY = _ulZ = 0; }
|
||||||
/** Checks if the iterator has not yet reached the end position. */
|
/** Checks if the iterator has not yet reached the end position. */
|
||||||
bool More (void) const
|
bool More (void) const
|
||||||
{ return (_ulZ < _rclGrid._ulCtGridsZ); }
|
{ return (_ulZ < _rclGrid._ulCtGridsZ); }
|
||||||
/** Go to the next grid. */
|
/** Go to the next grid. */
|
||||||
@@ -209,7 +209,7 @@ public:
|
|||||||
/** Searches for facets around the ray. */
|
/** Searches for facets around the ray. */
|
||||||
bool NextOnRay (std::vector<unsigned long> &raulElements);
|
bool NextOnRay (std::vector<unsigned long> &raulElements);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/** Returns the grid number of the current position. */
|
/** Returns the grid number of the current position. */
|
||||||
void GetGridPos (unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
|
void GetGridPos (unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
|
||||||
{ rulX = _ulX; rulY = _ulY; rulZ = _ulZ; }
|
{ rulX = _ulX; rulY = _ulY; rulZ = _ulZ; }
|
||||||
@@ -218,13 +218,13 @@ protected:
|
|||||||
const PointsGrid& _rclGrid; /**< The point grid. */
|
const PointsGrid& _rclGrid; /**< The point grid. */
|
||||||
unsigned long _ulX; /**< Number of grids in x. */
|
unsigned long _ulX; /**< Number of grids in x. */
|
||||||
unsigned long _ulY; /**< Number of grids in y. */
|
unsigned long _ulY; /**< Number of grids in y. */
|
||||||
unsigned long _ulZ; /**< Number of grids in z. */
|
unsigned long _ulZ; /**< Number of grids in z. */
|
||||||
Base::Vector3d _clPt; /**< Base point of search ray. */
|
Base::Vector3d _clPt; /**< Base point of search ray. */
|
||||||
Base::Vector3d _clDir; /**< Direction of search ray. */
|
Base::Vector3d _clDir; /**< Direction of search ray. */
|
||||||
bool _bValidRay; /**< Search ray ok? */
|
bool _bValidRay; /**< Search ray ok? */
|
||||||
float _fMaxSearchArea;
|
float _fMaxSearchArea;
|
||||||
/** Checks if a grid position is already visited by NextOnRay(). */
|
/** Checks if a grid position is already visited by NextOnRay(). */
|
||||||
struct GridElement
|
struct GridElement
|
||||||
{
|
{
|
||||||
GridElement( unsigned long x, unsigned long y, unsigned long z)
|
GridElement( unsigned long x, unsigned long y, unsigned long z)
|
||||||
{ this->x = x; this->y = y; this->z = z; }
|
{ this->x = x; this->y = y; this->z = z; }
|
||||||
@@ -232,7 +232,7 @@ protected:
|
|||||||
{
|
{
|
||||||
if ( x == pos.x)
|
if ( x == pos.x)
|
||||||
{ if ( y == pos.y) return z < pos.z; else return y < pos.y; }
|
{ if ( y == pos.y) return z < pos.z; else return y < pos.y; }
|
||||||
else
|
else
|
||||||
{ return x < pos.x; }
|
{ return x < pos.x; }
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
@@ -246,7 +246,7 @@ protected:
|
|||||||
inline Base::BoundBox3d PointsGrid::GetBoundBox (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const
|
inline Base::BoundBox3d PointsGrid::GetBoundBox (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const
|
||||||
{
|
{
|
||||||
double fX, fY, fZ;
|
double fX, fY, fZ;
|
||||||
|
|
||||||
fX = _fMinX + (double(ulX) * _fGridLenX);
|
fX = _fMinX + (double(ulX) * _fGridLenX);
|
||||||
fY = _fMinY + (double(ulY) * _fGridLenY);
|
fY = _fMinY + (double(ulY) * _fGridLenY);
|
||||||
fZ = _fMinZ + (double(ulZ) * _fGridLenZ);
|
fZ = _fMinZ + (double(ulZ) * _fGridLenZ);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ std::string PointsPy::representation(void) const
|
|||||||
|
|
||||||
PyObject *PointsPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper
|
PyObject *PointsPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper
|
||||||
{
|
{
|
||||||
// create a new instance of PointsPy and the Twin object
|
// create a new instance of PointsPy and the Twin object
|
||||||
return new PointsPy(new PointKernel);
|
return new PointsPy(new PointKernel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ PyObject *PointsPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Pyt
|
|||||||
int PointsPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
int PointsPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||||
{
|
{
|
||||||
PyObject *pcObj=0;
|
PyObject *pcObj=0;
|
||||||
if (!PyArg_ParseTuple(args, "|O", &pcObj)) // convert args: Python->C
|
if (!PyArg_ParseTuple(args, "|O", &pcObj)) // convert args: Python->C
|
||||||
return -1; // NULL triggers exception
|
return -1; // NULL triggers exception
|
||||||
|
|
||||||
// if no mesh is given
|
// if no mesh is given
|
||||||
@@ -93,26 +93,26 @@ PyObject* PointsPy::read(PyObject * args)
|
|||||||
{
|
{
|
||||||
const char* Name;
|
const char* Name;
|
||||||
if (!PyArg_ParseTuple(args, "s",&Name))
|
if (!PyArg_ParseTuple(args, "s",&Name))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
PY_TRY {
|
PY_TRY {
|
||||||
getPointKernelPtr()->load(Name);
|
getPointKernelPtr()->load(Name);
|
||||||
} PY_CATCH;
|
} PY_CATCH;
|
||||||
|
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* PointsPy::write(PyObject * args)
|
PyObject* PointsPy::write(PyObject * args)
|
||||||
{
|
{
|
||||||
const char* Name;
|
const char* Name;
|
||||||
if (!PyArg_ParseTuple(args, "s",&Name))
|
if (!PyArg_ParseTuple(args, "s",&Name))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
PY_TRY {
|
PY_TRY {
|
||||||
getPointKernelPtr()->save(Name);
|
getPointKernelPtr()->save(Name);
|
||||||
} PY_CATCH;
|
} PY_CATCH;
|
||||||
|
|
||||||
Py_Return;
|
Py_Return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* PointsPy::writeInventor(PyObject * args)
|
PyObject* PointsPy::writeInventor(PyObject * args)
|
||||||
@@ -239,7 +239,7 @@ PyObject *PointsPy::getCustomAttributes(const char* /*attr*/) const
|
|||||||
|
|
||||||
int PointsPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
int PointsPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ DlgPointsReadImp::DlgPointsReadImp(const char *FileName, QWidget* parent, Qt::W
|
|||||||
_FileName = FileName;
|
_FileName = FileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Destroys the object and frees any allocated resources
|
* Destroys the object and frees any allocated resources
|
||||||
*/
|
*/
|
||||||
DlgPointsReadImp::~DlgPointsReadImp()
|
DlgPointsReadImp::~DlgPointsReadImp()
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class Ui_DlgPointsRead;
|
|||||||
/** The points read dialog
|
/** The points read dialog
|
||||||
*/
|
*/
|
||||||
class DlgPointsReadImp : public QDialog
|
class DlgPointsReadImp : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -21,4 +21,4 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include "PreCompiled.h"
|
#include "PreCompiled.h"
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
# ifndef NOMINMAX
|
# ifndef NOMINMAX
|
||||||
# define NOMINMAX
|
# define NOMINMAX
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _PreComp_
|
#ifdef _PreComp_
|
||||||
|
|
||||||
@@ -79,4 +79,4 @@
|
|||||||
|
|
||||||
#endif //_PreComp_
|
#endif //_PreComp_
|
||||||
|
|
||||||
#endif // POINTSGUI_PRECOMPILED_H
|
#endif // POINTSGUI_PRECOMPILED_H
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ void ViewProviderPoints::setDisplayMode(const char* ModeName)
|
|||||||
SoDebugError::postWarning("ViewProviderPoints::setDisplayMode",
|
SoDebugError::postWarning("ViewProviderPoints::setDisplayMode",
|
||||||
"The number of points (%d) doesn't match with the number of colors (%d).", numPoints, colors->getSize());
|
"The number of points (%d) doesn't match with the number of colors (%d).", numPoints, colors->getSize());
|
||||||
#endif
|
#endif
|
||||||
// fallback
|
// fallback
|
||||||
setDisplayMaskMode("Point");
|
setDisplayMaskMode("Point");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -229,7 +229,7 @@ void ViewProviderPoints::setDisplayMode(const char* ModeName)
|
|||||||
SoDebugError::postWarning("ViewProviderPoints::setDisplayMode",
|
SoDebugError::postWarning("ViewProviderPoints::setDisplayMode",
|
||||||
"The number of points (%d) doesn't match with the number of normals (%d).", numPoints, normals->getSize());
|
"The number of points (%d) doesn't match with the number of normals (%d).", numPoints, normals->getSize());
|
||||||
#endif
|
#endif
|
||||||
// fallback
|
// fallback
|
||||||
setDisplayMaskMode("Point");
|
setDisplayMaskMode("Point");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -498,7 +498,7 @@ void ViewProviderScattered::cut(const std::vector<SbVec2f>& picked, Gui::View3DI
|
|||||||
remainValue.push_back( *jt );
|
remainValue.push_back( *jt );
|
||||||
else if (index != *pos)
|
else if (index != *pos)
|
||||||
remainValue.push_back( *jt );
|
remainValue.push_back( *jt );
|
||||||
else
|
else
|
||||||
++pos;
|
++pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Extracts the point data from the feature \a pcFeature and creates
|
* Extracts the point data from the feature \a pcFeature and creates
|
||||||
* an Inventor node \a SoNode with these data.
|
* an Inventor node \a SoNode with these data.
|
||||||
*/
|
*/
|
||||||
virtual void attach(App::DocumentObject *);
|
virtual void attach(App::DocumentObject *);
|
||||||
/// Update the point representation
|
/// Update the point representation
|
||||||
@@ -156,7 +156,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Extracts the point data from the feature \a pcFeature and creates
|
* Extracts the point data from the feature \a pcFeature and creates
|
||||||
* an Inventor node \a SoNode with these data.
|
* an Inventor node \a SoNode with these data.
|
||||||
*/
|
*/
|
||||||
virtual void attach(App::DocumentObject *);
|
virtual void attach(App::DocumentObject *);
|
||||||
/// Update the point representation
|
/// Update the point representation
|
||||||
|
|||||||
@@ -49,4 +49,4 @@ protected:
|
|||||||
} // namespace PointsGui
|
} // namespace PointsGui
|
||||||
|
|
||||||
|
|
||||||
#endif // POINTS_WORKBENCH_H
|
#endif // POINTS_WORKBENCH_H
|
||||||
|
|||||||
Reference in New Issue
Block a user