From: nds Date: Thu, 6 Apr 2017 13:10:37 +0000 (+0300) Subject: Issue #2082 Sketch multiple rotation does not work as expected: debug information X-Git-Tag: V_2.7.0~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=21a0c85b52bb93f94680e2342370764e6510e387;p=modules%2Fshaper.git Issue #2082 Sketch multiple rotation does not work as expected: debug information --- diff --git a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp index d7115a091..a7fe10313 100755 --- a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp +++ b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp @@ -27,6 +27,11 @@ #include #include +//#define DEBUG_POINT_INSIDE_SHAPE +#ifdef DEBUG_POINT_INSIDE_SHAPE +#include +#endif + #ifdef WIN32 #pragma warning(disable : 4996) // for sprintf #endif @@ -156,6 +161,9 @@ void appendPoint(const std::shared_ptr& thePoint, 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 } } @@ -196,6 +204,9 @@ void ModelGeomAlgo_Point2D::getPointsIntersectedShape( const std::list >& theFeatures, PointToRefsMap& thePointToAttributeOrObject) { +#ifdef DEBUG_POINT_INSIDE_SHAPE + std::cout << "ModelGeomAlgo_Point2D::getPointsIntersectedShape" << std::endl; +#endif GeomShapePtr aFeatureShape; { std::set anEdgeShapes; @@ -223,7 +234,15 @@ void ModelGeomAlgo_Point2D::getPointsIntersectedShape( 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 } } } @@ -252,6 +271,9 @@ void ModelGeomAlgo_Point2D::getPointsInsideShape( const std::shared_ptr& theDirY, PointToRefsMap& thePointToAttributeOrObject) { +#ifdef DEBUG_POINT_INSIDE_SHAPE + std::cout << "ModelGeomAlgo_Point2D::getPointsInsideShape:" << std::endl; +#endif std::set >::const_iterator anIt = theAttributes.begin(), aLast = theAttributes.end(); for (; anIt != aLast; anIt++) { @@ -268,6 +290,17 @@ void ModelGeomAlgo_Point2D::getPointsInsideShape( 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 } } }