Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A new event Visual Attributes Changed is defined for performance sake.
[modules/shaper.git]
/
src
/
SketchPlugin
/
SketchPlugin_Fillet.cpp
diff --git
a/src/SketchPlugin/SketchPlugin_Fillet.cpp
b/src/SketchPlugin/SketchPlugin_Fillet.cpp
index 519bb30c6795ddacb61c68a0574658fd3caad595..9507cad1a9970b0b557863383d559d498b114031 100644
(file)
--- a/
src/SketchPlugin/SketchPlugin_Fillet.cpp
+++ b/
src/SketchPlugin/SketchPlugin_Fillet.cpp
@@
-1,4
+1,4
@@
-// Copyright (C) 2014-201
7
CEA/DEN, EDF R&D
+// Copyright (C) 2014-201
9
CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@
-12,10
+12,9
@@
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA
//
//
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "SketchPlugin_Fillet.h"
//
#include "SketchPlugin_Fillet.h"
@@
-82,8
+81,9
@@
static std::set<FeaturePtr> findFeaturesToRemove(const FeaturePtr theFeature,
const AttributePtr theAttribute);
SketchPlugin_Fillet::SketchPlugin_Fillet()
const AttributePtr theAttribute);
SketchPlugin_Fillet::SketchPlugin_Fillet()
-: myFilletCreated(false)
+: myFilletCreated(false)
, myIsReversed(false)
{
{
+ myIsNotInversed[0] = myIsNotInversed[1] = true;
}
void SketchPlugin_Fillet::initAttributes()
}
void SketchPlugin_Fillet::initAttributes()
@@
-104,6
+104,10
@@
void SketchPlugin_Fillet::execute()
// create feature for fillet arc
FeaturePtr aFilletArc = createFilletArc();
// create feature for fillet arc
FeaturePtr aFilletArc = createFilletArc();
+ if (!aFilletArc) {
+ setError("Error: unable to create a fillet arc.");
+ return;
+ }
// collect features referred to the edges participating in fillet
AttributePoint2DPtr aFilletPoints[2];
// collect features referred to the edges participating in fillet
AttributePoint2DPtr aFilletPoints[2];
@@
-189,6
+193,11
@@
AISObjectPtr SketchPlugin_Fillet::getAISObject(AISObjectPtr thePrevious)
anAISObject = AISObjectPtr(new GeomAPI_AISObject);
}
anAISObject->createShape(anArcShape);
anAISObject = AISObjectPtr(new GeomAPI_AISObject);
}
anAISObject->createShape(anArcShape);
+ bool isAxiliary = false;
+ AttributeBooleanPtr aAttr = boolean(AUXILIARY_ID());
+ if (aAttr.get())
+ isAxiliary = aAttr->value();
+ SketchPlugin_Tools::customizeFeaturePrs(anAISObject, isAxiliary);
return anAISObject;
}
return anAISObject;
}
@@
-308,6
+317,10
@@
FeaturePtr SketchPlugin_Fillet::createFilletArc()
if (!myBaseFeatures[0] || !myBaseFeatures[1])
calculateFilletParameters();
if (!myBaseFeatures[0] || !myBaseFeatures[1])
calculateFilletParameters();
+ // fix for issue #2810 (sometimes, myCenterXY is NULL, fillet should report an error)
+ if (!myCenterXY)
+ return FeaturePtr();
+
// Create arc feature.
FeaturePtr aFilletArc = sketch()->addFeature(SketchPlugin_Arc::ID());
// Create arc feature.
FeaturePtr aFilletArc = sketch()->addFeature(SketchPlugin_Arc::ID());
@@
-565,7
+578,7
@@
double calculateFilletRadius(FeaturePtr theFilletFeatures[2])
if (anEdge)
aLengths[i] = anEdge->length();
}
if (anEdge)
aLengths[i] = anEdge->length();
}
- return
std::min(aLengths[0],
aLengths[1]) / 6.0;
+ return
(aLengths[0] < aLengths[1] ? aLengths[0] :
aLengths[1]) / 6.0;
}
std::set<FeaturePtr> findFeaturesToRemove(const FeaturePtr theFeature,
}
std::set<FeaturePtr> findFeaturesToRemove(const FeaturePtr theFeature,