-
-PartSet_OperationSketch::PartSet_OperationSketch(const QString& theId,
- QObject* theParent)
-: PartSet_OperationSketchBase(theId, theParent)
+PartSet_OperationSketch::PartSet_OperationSketch(const QString& theId, QObject* theParent)
+ : PartSet_OperationSketchBase(theId, theParent)
/// Initializes the operation with previously created feature. It is used in sequental operations
void PartSet_OperationSketch::initFeature(FeaturePtr theFeature)
{
/// Initializes the operation with previously created feature. It is used in sequental operations
void PartSet_OperationSketch::initFeature(FeaturePtr theFeature)
{
const std::list<ModuleBase_ViewerPrs>& theSelected,
const std::list<ModuleBase_ViewerPrs>& theHighlighted)
{
const std::list<ModuleBase_ViewerPrs>& theSelected,
const std::list<ModuleBase_ViewerPrs>& theHighlighted)
{
// if shift button is pressed and there are some already selected objects, the operation should
// not be started. We just want to combine some selected objects.
bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier);
// if shift button is pressed and there are some already selected objects, the operation should
// not be started. We just want to combine some selected objects.
bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier);
- std::string anOperationType = (theSelected.size() > 1)?
- PartSet_OperationFeatureEditMulti::Type() :
- PartSet_OperationFeatureEdit::Type();
+ std::string anOperationType =
+ (theSelected.size() > 1) ?
+ PartSet_OperationFeatureEditMulti::Type() : PartSet_OperationFeatureEdit::Type();
/// It is empty and we have to use the process mouse release to start edition operation
/// for these objects
if (theSelected.size() == 1) {
/// It is empty and we have to use the process mouse release to start edition operation
/// for these objects
if (theSelected.size() == 1) {
- ObjectPtr aFeature = theSelected.front().object();
- if (aFeature)
- restartOperation(PartSet_OperationFeatureEdit::Type(), aFeature);
+ ObjectPtr aObject = theSelected.front().object();
+ if (aObject) {
+ restartOperation(PartSet_OperationFeatureEdit::Type(), aObject);
+ }
return;
if (myFeatures.size() != 1) {
FeaturePtr aFeature = PartSet_Tools::nearestFeature(theEvent->pos(), theView, feature(),
myFeatures);
if (aFeature)
return;
if (myFeatures.size() != 1) {
FeaturePtr aFeature = PartSet_Tools::nearestFeature(theEvent->pos(), theView, feature(),
myFeatures);
if (aFeature)
- boost::shared_ptr<ModelAPI_AttributeRefList> aRefList =
- boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(aData->attribute(SketchPlugin_Sketch::FEATURES_ID()));
+ boost::shared_ptr<ModelAPI_AttributeRefList> aRefList = boost::dynamic_pointer_cast<
+ ModelAPI_AttributeRefList>(aData->attribute(SketchPlugin_Sketch::FEATURES_ID()));
std::list<ResultPtr> aResults = aFeature->results();
std::list<ResultPtr>::const_iterator aIt;
for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
std::list<ResultPtr> aResults = aFeature->results();
std::list<ResultPtr>::const_iterator aIt;
for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
- ModelAPI_EventCreator::get()->sendUpdated(*aIt,
- Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
+ ModelAPI_EventCreator::get()->sendUpdated(
+ *aIt, Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
}
//ModelAPI_EventCreator::get()->sendUpdated(aFeature,
// Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
}
//ModelAPI_EventCreator::get()->sendUpdated(aFeature,
// Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
- boost::shared_ptr<GeomDataAPI_Dir> aNormal =
- boost::dynamic_pointer_cast<GeomDataAPI_Dir>(aData->attribute(SketchPlugin_Sketch::NORM_ID()));
+ boost::shared_ptr<GeomDataAPI_Dir> aNormal = boost::dynamic_pointer_cast<GeomDataAPI_Dir>(
+ aData->attribute(SketchPlugin_Sketch::NORM_ID()));
// X axis is preferable to be dirX on the sketch
const double tol = Precision::Confusion();
bool isX = fabs(anA - 1.0) < tol && fabs(aB) < tol && fabs(aC) < tol;
// X axis is preferable to be dirX on the sketch
const double tol = Precision::Confusion();
bool isX = fabs(anA - 1.0) < tol && fabs(aB) < tol && fabs(aC) < tol;
- boost::shared_ptr<GeomAPI_Dir> aTempDir(isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0));
+ boost::shared_ptr<GeomAPI_Dir> aTempDir(
+ isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0));
boost::shared_ptr<GeomAPI_Dir> aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir)));
boost::shared_ptr<GeomAPI_Dir> aXDir(new GeomAPI_Dir(aYDir->cross(aNormDir)));
boost::shared_ptr<GeomAPI_Dir> aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir)));
boost::shared_ptr<GeomAPI_Dir> aXDir(new GeomAPI_Dir(aYDir->cross(aNormDir)));
- boost::shared_ptr<GeomDataAPI_Point> anOrigin =
- boost::dynamic_pointer_cast<GeomDataAPI_Point>(aData->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
+ boost::shared_ptr<GeomDataAPI_Point> anOrigin = boost::dynamic_pointer_cast<GeomDataAPI_Point>(
+ aData->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
- boost::shared_ptr<GeomDataAPI_Dir> aNormal =
- boost::dynamic_pointer_cast<GeomDataAPI_Dir>(aData->attribute(SketchPlugin_Sketch::NORM_ID()));
+ boost::shared_ptr<GeomDataAPI_Dir> aNormal = boost::dynamic_pointer_cast<GeomDataAPI_Dir>(
+ aData->attribute(SketchPlugin_Sketch::NORM_ID()));
- boost::shared_ptr<GeomDataAPI_Dir> aDirX =
- boost::dynamic_pointer_cast<GeomDataAPI_Dir>(aData->attribute(SketchPlugin_Sketch::DIRX_ID()));
+ boost::shared_ptr<GeomDataAPI_Dir> aDirX = boost::dynamic_pointer_cast<GeomDataAPI_Dir>(
+ aData->attribute(SketchPlugin_Sketch::DIRX_ID()));
- boost::shared_ptr<GeomDataAPI_Dir> aDirY =
- boost::dynamic_pointer_cast<GeomDataAPI_Dir>(aData->attribute(SketchPlugin_Sketch::DIRY_ID()));
+ boost::shared_ptr<GeomDataAPI_Dir> aDirY = boost::dynamic_pointer_cast<GeomDataAPI_Dir>(
+ aData->attribute(SketchPlugin_Sketch::DIRY_ID()));
emit featureConstructed(feature(), FM_Hide);
emit closeLocalContext();
emit planeSelected(aDir->x(), aDir->y(), aDir->z());
}
emit featureConstructed(feature(), FM_Hide);
emit closeLocalContext();
emit planeSelected(aDir->x(), aDir->y(), aDir->z());
}