-// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <AIS_InteractiveObject.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <SelectMgr_IndexedMapOfOwner.hxx>
-#include <V3d_Coordinate.hxx>
#include <QMouseEvent>
if (theView.IsNull())
return gp_Pnt();
- V3d_Coordinate XAt, YAt, ZAt;
+ Standard_Real XAt, YAt, ZAt;
theView->At(XAt, YAt, ZAt);
gp_Pnt AtPoint(XAt, YAt, ZAt);
gp_Vec aVec(anOriginPnt, thePoint);
if (!theView.IsNull()) {
- V3d_Coordinate XEye, YEye, ZEye, XAt, YAt, ZAt;
+ Standard_Real XEye, YEye, ZEye, XAt, YAt, ZAt;
theView->Eye(XEye, YEye, ZEye);
theView->At(XAt, YAt, ZAt);
anIntoResult->setValue(SKETCH_PROJECTION_INCLUDE_INTO_RESULT);
aProjectionFeature->execute();
+ ModelAPI_ValidatorsFactory* aValidators = ModelAPI_Session::get()->validators();
+ bool isValid = aValidators->validate(aProjectionFeature);
+
// if projection feature has not been created, exit
AttributeRefAttrPtr aRefAttr = aProjectionFeature->data()->refattr(
SketchPlugin_Projection::PROJECTED_FEATURE_ID());
- if (!aRefAttr || !aRefAttr->isInitialized())
+ if (!isValid || !aRefAttr || !aRefAttr->isInitialized())
{
// remove external feature if the attribute is not filled
std::set<FeaturePtr> aFeatures;
{
theColor.clear();
// get default color from the preferences manager for the given result
- if (theColor.empty()) {
- std::string aSection, aName, aDefault;
- theObject->colorConfigInfo(aSection, aName, aDefault);
- if (!aSection.empty() && !aName.empty()) {
- theColor = Config_PropManager::color(aSection, aName);
- }
+ std::string aSection, aName, aDefault;
+ theObject->colorConfigInfo(aSection, aName, aDefault);
+ if (!aSection.empty() && !aName.empty()) {
+ theColor = Config_PropManager::color(aSection, aName);
}
if (!isEmptyColorValid && theColor.empty()) {
// all AIS objects, where the color is not set, are in black.