From: mpv Date: Thu, 4 Sep 2014 06:46:02 +0000 (+0400) Subject: Debug of sketcher debug validators X-Git-Tag: V_0.4.4~86 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a970d71a76da019f965cd16a346737dc4cd9b634;p=modules%2Fshaper.git Debug of sketcher debug validators --- diff --git a/src/Config/Config_XMLReader.cpp b/src/Config/Config_XMLReader.cpp index f75748f18..26da54b51 100644 --- a/src/Config/Config_XMLReader.cpp +++ b/src/Config/Config_XMLReader.cpp @@ -14,12 +14,9 @@ #include #include -/* - #ifdef WIN32 - //For GetModuleFileNameW - #include - #endif - */ +#ifdef WIN32 +#pragma warning(disable : 4996) // for getenv +#endif #ifdef _DEBUG #include diff --git a/src/GeomAPI/GeomAPI_Curve.cpp b/src/GeomAPI/GeomAPI_Curve.cpp index 77bf7d9a2..53a845810 100644 --- a/src/GeomAPI/GeomAPI_Curve.cpp +++ b/src/GeomAPI/GeomAPI_Curve.cpp @@ -28,7 +28,7 @@ GeomAPI_Curve::GeomAPI_Curve(const boost::shared_ptr& theShape) Standard_Real aStart, anEnd; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aStart, anEnd); if (!aCurve.IsNull()) { - setImpl(&aCurve); + setImpl(new Handle(Geom_Curve)(aCurve)); } } } diff --git a/src/SketchPlugin/SketchPlugin_Plugin.cpp b/src/SketchPlugin/SketchPlugin_Plugin.cpp index 04ad750a2..930253dad 100644 --- a/src/SketchPlugin/SketchPlugin_Plugin.cpp +++ b/src/SketchPlugin/SketchPlugin_Plugin.cpp @@ -29,9 +29,9 @@ SketchPlugin_Plugin::SketchPlugin_Plugin() ModelAPI_ValidatorsFactory* aFactory = aMgr->validators(); aFactory->registerValidator("SketchPlugin_DistanceAttrValidator", new SketchPlugin_DistanceAttrValidator); - aFactory->registerValidator("Sketch_ResultPointValidator", new SketchPlugin_ResultPointValidator); - aFactory->registerValidator("Sketch_ResultLineValidator", new SketchPlugin_ResultLineValidator); - aFactory->registerValidator("Sketch_ResultArcValidator", new SketchPlugin_ResultArcValidator); + aFactory->registerValidator("SketchPlugin_ResultPointValidator", new SketchPlugin_ResultPointValidator); + aFactory->registerValidator("SketchPlugin_ResultLineValidator", new SketchPlugin_ResultLineValidator); + aFactory->registerValidator("SketchPlugin_ResultArcValidator", new SketchPlugin_ResultArcValidator); // register this plugin ModelAPI_PluginManager::get()->registerPlugin(this); diff --git a/src/SketchPlugin/SketchPlugin_ResultValidators.cpp b/src/SketchPlugin/SketchPlugin_ResultValidators.cpp index b611a9970..e40022f7c 100644 --- a/src/SketchPlugin/SketchPlugin_ResultValidators.cpp +++ b/src/SketchPlugin/SketchPlugin_ResultValidators.cpp @@ -29,17 +29,6 @@ bool SketchPlugin_ResultLineValidator::isValid(const ObjectPtr theObject) const return false; boost::shared_ptr aShape = ModelAPI_Tools::shape(aResult); return aShape && aShape->isEdge() && GeomAPI_Curve(aShape).isLine(); - - /* - if (aShape.ShapeType() == TopAbs_EDGE) { - TopoDS_Edge aEdge = TopoDS::Edge(aShape); - Standard_Real aStart, aEnd; - Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aEdge, aStart, aEnd); - GeomAdaptor_Curve aAdaptor(aCurve); - return aAdaptor.GetType() == GeomAbs_Line; - } - return false; - */ } bool SketchPlugin_ResultArcValidator::isValid(const ObjectPtr theObject) const diff --git a/src/SketchPlugin/plugin-Sketch.xml b/src/SketchPlugin/plugin-Sketch.xml index 804f1bb32..7c26e28e2 100644 --- a/src/SketchPlugin/plugin-Sketch.xml +++ b/src/SketchPlugin/plugin-Sketch.xml @@ -29,12 +29,12 @@