]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Debug of sketcher debug validators
authormpv <mikhail.ponikarov@opencascade.com>
Thu, 4 Sep 2014 06:46:02 +0000 (10:46 +0400)
committermpv <mikhail.ponikarov@opencascade.com>
Thu, 4 Sep 2014 06:46:02 +0000 (10:46 +0400)
src/Config/Config_XMLReader.cpp
src/GeomAPI/GeomAPI_Curve.cpp
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_ResultValidators.cpp
src/SketchPlugin/plugin-Sketch.xml

index f75748f1847a091e635de8664a963f99fd9531ad..26da54b51d7f316cc77427cb8ededff4f4652159 100644 (file)
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 
-/*
- #ifdef WIN32
- //For GetModuleFileNameW
- #include <windows.h>
- #endif
- */
+#ifdef WIN32
+#pragma warning(disable : 4996) // for getenv
+#endif
 
 #ifdef _DEBUG
 #include <iostream>
index 77bf7d9a2660842d0fee494d689961fbe6b57106..53a84581054f743f48e1bb1dafadb93e72b5fde6 100644 (file)
@@ -28,7 +28,7 @@ GeomAPI_Curve::GeomAPI_Curve(const boost::shared_ptr<GeomAPI_Shape>& 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));
     }
   }
 }
index 04ad750a2ee821e47d4afde0d4ac0e212bab19a0..930253dad1f502a3e281b4183bcad9282fba9a43 100644 (file)
@@ -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);
index b611a9970867576cf09b66c48216afefb5f2bf12..e40022f7cdc1cf10529424c8e6dbbfb9b8b1ee4d 100644 (file)
@@ -29,17 +29,6 @@ bool SketchPlugin_ResultLineValidator::isValid(const ObjectPtr theObject) const
     return false;
   boost::shared_ptr<GeomAPI_Shape> 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
index 804f1bb32609a9d858b818f13d125e28a5a2cf43..7c26e28e2df70a23a02879c8e4100e4d01fa572f 100644 (file)
       <feature id="SketchConstraintDistance" title="Distance" tooltip="Create constraint for the distance from a point to an object">
         <label title="Select point and another feature (point or point on line) between which to calculate distance" tooltip="Select point and another feature (point or point on line) between which to calculate distance"/>
         <feature_or_attribute_selector id="ConstraintEntityA" label="First object" tooltip="Select an point in the viewer">
-          <validator id="Model_ResultPointValidator"/>
-          <validator id="Model_ResultLineValidator"/>
+          <validator id="SketchPlugin_ResultPointValidator"/>
+          <validator id="SketchPlugin_ResultLineValidator"/>
         </feature_or_attribute_selector>
         <feature_or_attribute_selector id="ConstraintEntityB" label="Last object" tooltip="Select an point in the viewer">
-          <validator id="Model_ResultPointValidator"/>
-          <validator id="Model_ResultLineValidator"/>
+          <validator id="SketchPlugin_ResultPointValidator"/>
+          <validator id="SketchPlugin_ResultLineValidator"/>
           <validator id="SketchPlugin_DistanceAttrValidator" parameters="ConstraintEntityA"/>
         </feature_or_attribute_selector>
         <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
@@ -45,7 +45,7 @@
       <feature id="SketchConstraintLength" title="Length" tooltip="Create constraint for the given length of a line segment">
         <label title="Select a line on which to calculate lenght" tooltip="Select a line on which to calculate lenght"/>
         <feature_selector id="ConstraintEntityA" label="Line" tooltip="Select an line in the viewer">
-          <validator id="Model_ResultLineValidator"/>
+          <validator id="SketchPlugin_ResultLineValidator"/>
         </feature_selector>
         <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
         <doublevalue_editor label="Value" tooltip="Constraint value" id="ConstraintValue"/>
@@ -55,7 +55,7 @@
       <feature id="SketchConstraintRadius" title="Radius" tooltip="Create constraint for the given radius of a circle or an arc">
         <label title="Select a circle or an arc on which to calculate radius" tooltip="Select a circle or an arc on which to calculate radius"/>
         <feature_selector id="ConstraintEntityA" label="Circle or Arc" tooltip="Select a circle or an arc in the viewer">
-          <validator id="Model_ResultArcValidator"/>
+          <validator id="SketchPlugin_ResultArcValidator"/>
         </feature_selector>
         <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
         <doublevalue_editor label="Value" tooltip="Constraint value" id="ConstraintValue"/>
       
       <feature id="SketchConstraintParallel" title="Parallel" tooltip="Create constraint defining two parallel lines">
         <feature_selector id="ConstraintEntityA" label="First line" tooltip="Select an line in the viewer">
-          <validator id="Model_ResultLineValidator"/>
+          <validator id="SketchPlugin_ResultLineValidator"/>
         </feature_selector>
         <feature_selector id="ConstraintEntityB" label="Last line" tooltip="Select an line in the viewer">
-          <validator id="Model_ResultLineValidator"/>
+          <validator id="SketchPlugin_ResultLineValidator"/>
         </feature_selector>
         <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
         <validator id="PartSet_ParallelValidator"/>
       
       <feature id="SketchConstraintPerpendicular" title="Perpendicular" tooltip="Create constraint defining two perpendicular lines">
         <feature_selector id="ConstraintEntityA" label="First line" tooltip="Select an line in the viewer">
-          <validator id="Model_ResultLineValidator"/>
+          <validator id="SketchPlugin_ResultLineValidator"/>
         </feature_selector>
         <feature_selector id="ConstraintEntityB" label="Last line" tooltip="Select an line in the viewer">
-          <validator id="Model_ResultLineValidator"/>
+          <validator id="SketchPlugin_ResultLineValidator"/>
         </feature_selector>
         <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
         <validator id="PartSet_PerpendicularValidator"/>