#include <GeomAPI_Lin.h>
#include <GeomAPI_Circ.h>
+//#define DEBUG_POINT_INSIDE_SHAPE
+#ifdef DEBUG_POINT_INSIDE_SHAPE
+#include <iostream>
+#endif
+
#ifdef WIN32
#pragma warning(disable : 4996) // for sprintf
#endif
anObjects.push_back(theResult);
thePointToAttributeOrObject[thePoint] = std::make_pair(anAttributes, anObjects);
}
+#ifdef DEBUG_POINT_INSIDE_SHAPE
+ std::cout << "["<< thePoint->x() << ", " << thePoint->y() << "," << thePoint->z() << "]";
+#endif
}
}
const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
PointToRefsMap& thePointToAttributeOrObject)
{
+#ifdef DEBUG_POINT_INSIDE_SHAPE
+ std::cout << "ModelGeomAlgo_Point2D::getPointsIntersectedShape" << std::endl;
+#endif
GeomShapePtr aFeatureShape;
{
std::set<ResultPtr> anEdgeShapes;
GeomShapePtr aShape = aResult->shape();
GeomShapePtr aShapeOfIntersection = aFeatureShape->intersect(aShape);
+#ifdef DEBUG_POINT_INSIDE_SHAPE
+ int aPrevSize = thePointToAttributeOrObject.size();
+#endif
appendShapePoints(aShapeOfIntersection, aResult, thePointToAttributeOrObject);
+#ifdef DEBUG_POINT_INSIDE_SHAPE
+ if (aPrevSize != thePointToAttributeOrObject.size())
+ std::cout << " <- appendShapePoints"
+ << thePointToAttributeOrObject.size() - aPrevSize << std::endl;
+#endif
}
}
}
const std::shared_ptr<GeomAPI_Dir>& theDirY,
PointToRefsMap& thePointToAttributeOrObject)
{
+#ifdef DEBUG_POINT_INSIDE_SHAPE
+ std::cout << "ModelGeomAlgo_Point2D::getPointsInsideShape:" << std::endl;
+#endif
std::set<std::shared_ptr<GeomDataAPI_Point2D> >::const_iterator anIt = theAttributes.begin(),
aLast = theAttributes.end();
for (; anIt != aLast; anIt++) {
anAttributes.push_back(anAttribute);
thePointToAttributeOrObject[aProjectedPoint] = std::make_pair(anAttributes, anObjects);
}
+#ifdef DEBUG_POINT_INSIDE_SHAPE
+ std::cout << " " << anAttribute->owner()->data()->name() << ": " << anAttribute->id()
+ << "[" << aPoint->x() << ", " << aPoint->y() << ", " << aPoint->z() << "]"
+ << std::endl;
+#endif
+ }
+ else {
+#ifdef DEBUG_POINT_INSIDE_SHAPE
+ std::cout << " " << anAttribute->owner()->data()->name() << ": " << anAttribute->id()
+ << "OUT of shape" << std::endl;
+#endif
}
}
}