---
-Checks: >
- clang-diagnostic-*,
- clang-analyzer-*,
- modernize-use-override,modernize-use-nullptr,modernize-use-using,modernize-use-default-member-init,
- modernize-loop-convert,modernize-use-auto,modernize-redundant-void-arg,modernize-type-traits,
- modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,
- misc-include-cleaner,misc-const-correctness,misc-unused-parameters
+Checks: |
+ clang-diagnostic-*,clang-analyzer-*,modernize-use-override,modernize-use-nullptr,modernize-use-using,modernize-use-default-member-init,modernize-loop-convert,modernize-use-auto,modernize-redundant-void-arg,modernize-type-traits,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,misc-include-cleaner,misc-const-correctness,misc-unused-parameters
WarningsAsErrors: ''
HeaderFilterRegex: .*SHAPER.*
AnalyzeTemporaryDtors: false
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
+ exclude: .*[Tt]est.*
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]
rev: v0.1 # Use the sha / tag you want to point at
hooks:
- id: clang-format
- - id: clang-tidy
+ # - id: clang-tidy
+ # files: |
+ # (?x)^(
+ # .*\.cpp|
+ # .*\.cxx
+ # )$
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.7.0-4
hooks:
return True
if not (find_bin(args.black_bin) and find_bin(args.clang_format_bin)):
- print(f"Missing binaries must be installed. Abort.")
+ print("Missing binaries must be installed. Abort.")
sys.exit(1)
# collect paths of all the C++ source files
name = self.extract_text(first["name"])
if name[:8] == "operator": # Don't handle operators yet.
return
- if not "definition" in first or kind in ["variable", "typedef"]:
+ if "definition" not in first or kind in ["variable", "typedef"]:
return
data = self.extract_text(first["definition"])
}
//==================================================================================================
-BuildAPI_CompSolid::~BuildAPI_CompSolid() {}
+BuildAPI_CompSolid::~BuildAPI_CompSolid() = default;
//==================================================================================================
void BuildAPI_CompSolid::setBase(
/// Destructor.
BUILDAPI_EXPORT
- virtual ~BuildAPI_CompSolid();
+ ~BuildAPI_CompSolid() override;
INTERFACE_1(BuildPlugin_CompSolid::ID(), baseObjects,
BuildPlugin_CompSolid::BASE_OBJECTS_ID(),
/// Dump wrapped feature
BUILDAPI_EXPORT
- virtual void dump(ModelHighAPI_Dumper &theDumper) const;
+ void dump(ModelHighAPI_Dumper &theDumper) const override;
};
/// Pointer on CompSolid object.
-typedef std::shared_ptr<BuildAPI_CompSolid> CompSolidPtr;
+using CompSolidPtr = std::shared_ptr<BuildAPI_CompSolid>;
/// \ingroup CPPHighAPI
/// \brief Create CompSolid feature.
}
}
-BuildAPI_Filling::~BuildAPI_Filling() {}
+BuildAPI_Filling::~BuildAPI_Filling() = default;
void BuildAPI_Filling::execIfBaseNotEmpty() {
if (baseObjects()->size() > 0)
const double theTolerance3D, const bool theApproximate);
/// Destructor.
- BUILDAPI_EXPORT virtual ~BuildAPI_Filling();
+ BUILDAPI_EXPORT ~BuildAPI_Filling() override;
INTERFACE_8(
BuildPlugin_Filling::ID(), baseObjects,
BUILDAPI_EXPORT void setApproximation(const bool theApproximate);
/// Dump wrapped feature
- BUILDAPI_EXPORT virtual void dump(ModelHighAPI_Dumper &theDumper) const;
+ BUILDAPI_EXPORT void dump(ModelHighAPI_Dumper &theDumper) const override;
private:
void execIfBaseNotEmpty();
};
/// Pointer on Face object.
-typedef std::shared_ptr<BuildAPI_Filling> FillingPtr;
+using FillingPtr = std::shared_ptr<BuildAPI_Filling>;
/// \ingroup CPPHighAPI
/// \brief Create Filling feature.
}
/// \return the kind of a feature.
- BUILDPLUGIN_EXPORT virtual const std::string &getKind() {
+ BUILDPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = BuildPlugin_CompSolid::ID();
return MY_KIND;
}
/// Request for initialization of data model of the feature: adding all
/// attributes.
- BUILDPLUGIN_EXPORT virtual void initAttributes();
+ BUILDPLUGIN_EXPORT void initAttributes() override;
};
#endif
}
/// \return the kind of a feature.
- BUILDPLUGIN_EXPORT virtual const std::string &getKind() {
+ BUILDPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = BuildPlugin_Filling::ID();
return MY_KIND;
}
/// Request for initialization of data model of the feature: adding all
/// attributes.
- BUILDPLUGIN_EXPORT virtual void initAttributes();
+ BUILDPLUGIN_EXPORT void initAttributes() override;
/// Creates a new part document if needed.
- BUILDPLUGIN_EXPORT virtual void execute();
+ BUILDPLUGIN_EXPORT void execute() override;
/// Called on change of any argument-attribute of this object.
/// \param[in] theID identifier of changed attribute.
- BUILDPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ BUILDPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
private:
/// Convert shape to edge according to construction method
#include <sstream>
//=================================================================================================
-BuildPlugin_Interpolation::BuildPlugin_Interpolation() {}
+BuildPlugin_Interpolation::BuildPlugin_Interpolation() = default;
//=================================================================================================
void BuildPlugin_Interpolation::initAttributes() {
// Store result.
ResultBodyPtr aResultBody = document()->createBody(data());
- std::set<GeomShapePtr>::const_iterator aContextIt = aContexts.begin();
+ auto aContextIt = aContexts.begin();
for (; aContextIt != aContexts.end(); aContextIt++) {
aResultBody->storeModified(*aContextIt, anEdge,
aContextIt == aContexts.begin());
// store the list of parameters to store if changed
AttributeRefListPtr aParams = reflist(ARGUMENTS_ID());
aParams->clear();
- std::list<ResultParameterPtr>::const_iterator aNewIter =
- aParamsList.begin();
+ auto aNewIter = aParamsList.begin();
for (; aNewIter != aParamsList.end(); aNewIter++) {
aParams->append(*aNewIter);
}
}
/// \return the kind of a feature.
- BUILDPLUGIN_EXPORT virtual const std::string &getKind() {
+ BUILDPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = BuildPlugin_Interpolation::ID();
return MY_KIND;
}
/// Request for initialization of data model of the feature: adding all
/// attributes.
- BUILDPLUGIN_EXPORT virtual void initAttributes();
+ BUILDPLUGIN_EXPORT void initAttributes() override;
/// Creates a new part document if needed.
- BUILDPLUGIN_EXPORT virtual void execute();
+ BUILDPLUGIN_EXPORT void execute() override;
/// Called on change of any argument-attribute of this object.
/// \param[in] theID identifier of changed attribute.
- BUILDPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ BUILDPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
protected:
/// Evaluates the expression x(t), y(t),z(t) in value table.
}
/// \return the kind of a feature.
- BUILDPLUGIN_EXPORT virtual const std::string &getKind() {
+ BUILDPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = BuildPlugin_Solid::ID();
return MY_KIND;
}
/// Request for initialization of data model of the feature: adding all
/// attributes.
- BUILDPLUGIN_EXPORT virtual void initAttributes();
+ BUILDPLUGIN_EXPORT void initAttributes() override;
/// Creates a new part document if needed.
- BUILDPLUGIN_EXPORT virtual void execute();
+ BUILDPLUGIN_EXPORT void execute() override;
protected:
/// Explode compound to get single shape
}
/// Returns the kind of a feature
- COLLECTIONPLUGIN_EXPORT virtual const std::string &getKind() {
+ COLLECTIONPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = CollectionPlugin_Group::ID();
return MY_KIND;
}
/// Creates a new group result if needed
- COLLECTIONPLUGIN_EXPORT virtual void execute();
+ COLLECTIONPLUGIN_EXPORT void execute() override;
/// Request for initialization of data model of the feature: adding all
/// attributes
- COLLECTIONPLUGIN_EXPORT virtual void initAttributes();
+ COLLECTIONPLUGIN_EXPORT void initAttributes() override;
/// Result of groups is created on the fly and don't stored to the document
- COLLECTIONPLUGIN_EXPORT virtual bool isPersistentResult() { return true; }
+ COLLECTIONPLUGIN_EXPORT bool isPersistentResult() override { return true; }
/// Use plugin manager for features creation
CollectionPlugin_Group();
/// Used for the split action of the group (Move to the end and split)
- COLLECTIONPLUGIN_EXPORT virtual bool
- customAction(const std::string &theActionId);
+ COLLECTIONPLUGIN_EXPORT bool
+ customAction(const std::string &theActionId) override;
};
#endif
#include <GeomAlgoAPI_CompoundBuilder.h>
#include <GeomAlgoAPI_ShapeTools.h>
-typedef std::set<GeomShapePtr, GeomAPI_Shape::ComparatorWithOri> SetOfShape;
+using SetOfShape = std::set<GeomShapePtr, GeomAPI_Shape::ComparatorWithOri>;
-CollectionPlugin_GroupIntersection::CollectionPlugin_GroupIntersection() {}
+CollectionPlugin_GroupIntersection::CollectionPlugin_GroupIntersection() =
+ default;
void CollectionPlugin_GroupIntersection::initAttributes() {
data()->addAttribute(CollectionPlugin_GroupIntersection::LIST_ID(),
SetOfShape aSubs;
explodeCompound(theCompound, aSubs);
- ListOfShape::iterator anIt = theShapes.begin();
+ auto anIt = theShapes.begin();
while (anIt != theShapes.end()) {
if (aSubs.find(*anIt) == aSubs.end()) {
// the shape is not found
- ListOfShape::iterator aRemoveIt = anIt++;
+ auto aRemoveIt = anIt++;
theShapes.erase(aRemoveIt);
} else
++anIt;
}
/// Returns the kind of a feature
- COLLECTIONPLUGIN_EXPORT virtual const std::string &getKind() {
+ COLLECTIONPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = CollectionPlugin_GroupIntersection::ID();
return MY_KIND;
}
/// Creates a new group result if needed
- COLLECTIONPLUGIN_EXPORT virtual void execute();
+ COLLECTIONPLUGIN_EXPORT void execute() override;
/// Request for initialization of data model of the feature: adding all
/// attributes
- COLLECTIONPLUGIN_EXPORT virtual void initAttributes();
+ COLLECTIONPLUGIN_EXPORT void initAttributes() override;
/// Use plugin manager for features creation
CollectionPlugin_GroupIntersection();
class CollectionPlugin_GroupOperation : public CollectionPlugin_Group {
public:
/// Result of groups is created on the fly and don't stored to the document
- COLLECTIONPLUGIN_EXPORT virtual bool isPersistentResult() { return true; }
+ COLLECTIONPLUGIN_EXPORT bool isPersistentResult() override { return true; }
protected:
/// Updates the type of selection list based on types of selected groups
va_start(args, theNodeName); // init list; point to last defined argument
while (true) {
char *anArg = va_arg(args, char *); // get next argument
- if (anArg == NULL)
+ if (anArg == nullptr)
break;
if (!xmlStrcmp(aName, (const xmlChar *)anArg)) {
va_end(args); // cleanup the system stack
va_start(args, theNodeName); // init list; point to last defined argument
while (true) {
char *anArg = va_arg(args, char *); // get next argument
- if (anArg == NULL)
+ if (anArg == nullptr)
break;
if (!xmlStrcmp(aName, (const xmlChar *)anArg)) {
va_end(args); // cleanup the system stack
xmlNodePtr hasParentRecursive(xmlNodePtr theNode,
const std::vector<const char *> &theNodeNames) {
if (!hasParent(theNode)) {
- return 0; // have no parents at all
+ return nullptr; // have no parents at all
}
xmlNodePtr aNode = theNode->parent;
const xmlChar *aName = aNode->name;
if (!aName || !isElementNode(aNode)) {
- return 0;
+ return nullptr;
}
- for (size_t anIndex = 0; anIndex < theNodeNames.size(); ++anIndex) {
- if (!xmlStrcmp(aName, (const xmlChar *)theNodeNames[anIndex]))
+ for (auto theNodeName : theNodeNames) {
+ if (!xmlStrcmp(aName, (const xmlChar *)theNodeName))
return aNode;
}
return hasParentRecursive(aNode, theNodeNames);
aNodeNames.push_back(theNodeName);
while (true) {
char *anArg = va_arg(args, char *); // get next argument
- if (anArg == NULL)
+ if (anArg == nullptr)
break;
aNodeNames.push_back(anArg);
}
#include <string>
//>> Forward declaration of xmlNodePtr.
-typedef struct _xmlNode xmlNode;
-typedef xmlNode *xmlNodePtr;
+using xmlNode = struct _xmlNode;
+using xmlNodePtr = xmlNode *;
struct _xmlNode;
//<<
//>> Forward declaration of xmlDocPtr.
-typedef struct _xmlDoc xmlDoc;
-typedef xmlDoc *xmlDocPtr;
+using xmlDoc = struct _xmlDoc;
+using xmlDocPtr = xmlDoc *;
struct _xmlDoc;
//<<
*/
CONFIG_EXPORT bool isNode(xmlNodePtr theNode, const char *theNodeName, ...);
-//#define isNode(p) _isNode(p, NULL)
+// #define isNode(p) _isNode(p, NULL)
/*!
* Checks if the given node is attribute node.
/// Constructs Config_FeatureMessage
CONFIG_EXPORT Config_FeatureMessage(const Events_ID theId,
- const void *theParent = 0);
+ const void *theParent = nullptr);
/// Deletes Config_FeatureMessage
- CONFIG_EXPORT virtual ~Config_FeatureMessage();
+ CONFIG_EXPORT ~Config_FeatureMessage() override;
// Auto-generated getters/setters
/// Feature's Id
public:
/// Constructor
- CONFIG_EXPORT Config_ModuleReader(const char *theEventGenerated = 0);
+ CONFIG_EXPORT Config_ModuleReader(const char *theEventGenerated = nullptr);
/// Destructor
- CONFIG_EXPORT virtual ~Config_ModuleReader();
+ CONFIG_EXPORT ~Config_ModuleReader() override;
/// Returns map that describes which file contains a feature
/// (the feature is key, the file is value)
CONFIG_EXPORT const std::map<std::string, std::string> &
protected:
/// Recursively process the given xmlNode
- virtual void processNode(xmlNodePtr aNode);
+ void processNode(xmlNodePtr aNode) override;
/// Defines if the reader should process children of the given node
- virtual bool processChildren(xmlNodePtr aNode);
+ bool processChildren(xmlNodePtr aNode) override;
/// check if dependencies of the given node are in the list of loaded modules
bool hasRequiredModules(xmlNodePtr aNode) const;
/// reads info about plugin's features from plugin xml description
std::string myMax; // Maximal value
};
-typedef std::list<Config_Prop *> Config_Properties;
+using Config_Properties = std::list<Config_Prop *>;
#endif
#include <string>
/// The definition provides collection and writing of missed translations
-//#define MISSED_TRANSLATION
+// #define MISSED_TRANSLATION
/**
* \class Config_Translator
#include <string>
//>> Forward declaration of xmlNodePtr.
-typedef struct _xmlNode xmlNode;
-typedef xmlNode *xmlNodePtr;
+using xmlNode = struct _xmlNode;
+using xmlNodePtr = xmlNode *;
struct _xmlNode;
//<<
//>> Forward declaration of xmlDocPtr.
-typedef struct _xmlDoc xmlDoc;
-typedef xmlDoc *xmlDocPtr;
+using xmlDoc = struct _xmlDoc;
+using xmlDocPtr = xmlDoc *;
struct _xmlDoc;
//<<
Config_XMLReader::Config_XMLReader(const std::string &theXmlFileName,
bool isXMLContent)
- : myXmlDoc(NULL), myRootFileName(theXmlFileName) {
+ : myXmlDoc(nullptr), myRootFileName(theXmlFileName) {
isFromMemory = isXMLContent;
if (!isXMLContent) {
myDocumentPath = findConfigFile(theXmlFileName);
break; // no more solutions
}
- if (myXmlDoc != NULL) { // clear the previous XML document - now the new one
- // will be opened
+ if (myXmlDoc != nullptr) { // clear the previous XML document - now the new
+ // one will be opened
xmlFreeDoc(myXmlDoc);
- myXmlDoc = NULL;
+ myXmlDoc = nullptr;
}
xmlNodePtr aRoot = findRoot(aFoundFile);
readRecursively(aRoot);
xmlNodePtr Config_XMLReader::findRoot(const std::string theDocumentPath) {
std::string aDocPath =
theDocumentPath.empty() ? myDocumentPath : theDocumentPath;
- if (myXmlDoc == NULL) {
+ if (myXmlDoc == nullptr) {
myXmlDoc = xmlParseFile(aDocPath.c_str());
}
- if (myXmlDoc == NULL) {
+ if (myXmlDoc == nullptr) {
#ifdef _DEBUG
std::cout << "Config_XMLReader::import: "
<< "Document " << aDocPath << " is not parsed successfully."
<< std::endl;
#endif
- return NULL;
+ return nullptr;
}
xmlNodePtr aRoot = xmlDocGetRootElement(myXmlDoc);
#ifdef _DEBUG
std::string aKey =
std::string(theNodeName) + ":" + std::string(theNodeAttribute);
bool result = false;
- std::map<std::string, std::string>::iterator anEntry =
- myCachedAttributes.find(aKey);
+ auto anEntry = myCachedAttributes.find(aKey);
if (anEntry != myCachedAttributes.end()) {
myCachedAttributes.erase(anEntry);
result = true;
#include <string>
//>> Forward declaration of xmlNodePtr.
-typedef struct _xmlNode xmlNode;
-typedef xmlNode *xmlNodePtr;
+using xmlNode = struct _xmlNode;
+using xmlNodePtr = xmlNode *;
struct _xmlNode;
//<<
//>> Forward declaration of xmlDocPtr.
-typedef struct _xmlDoc xmlDoc;
-typedef xmlDoc *xmlDocPtr;
+using xmlDoc = struct _xmlDoc;
+using xmlDocPtr = xmlDoc *;
struct _xmlDoc;
//<<
# do not export picture
if aResult.hasTexture() is True:
continue
- if not aResult is None:
+ if aResult is not None:
if (not aResult.shape() or aResult.shape().isNull()) and isPart:
aPart = model.modelAPI_ResultPart(aResult)
aPartDoc = aPart.partDoc()
# ExportFeature class definition
import ModelAPI
-import ExchangeAPI
import EventsAPI
from GeomAPI import GeomAPI_Shape, GeomAPI_ShapeExplorer
import GeomAlgoAPI
anId = GeomAlgoAPI.GeomAlgoAPI_CompoundBuilder.id(
aResShape, anExplorer.current()
)
- if anId > 0 and not anId in aGroupHasIndex:
+ if anId > 0 and anId not in aGroupHasIndex:
aGroupIndices.append(anId)
aGroupHasIndex[anId] = 0
anExplorer.next()
static const double defaultAxisSize = 100;
-ConstructionPlugin_Axis::ConstructionPlugin_Axis() {}
+ConstructionPlugin_Axis::ConstructionPlugin_Axis() = default;
void ConstructionPlugin_Axis::initAttributes() {
data()->addAttribute(ConstructionPlugin_Axis::METHOD(),
data()->selection(ConstructionPlugin_Axis::POINT_FIRST());
AttributeSelectionPtr aRef2 =
data()->selection(ConstructionPlugin_Axis::POINT_SECOND());
- if ((aRef1.get() != NULL) && (aRef2.get() != NULL)) {
+ if ((aRef1.get() != nullptr) && (aRef2.get() != nullptr)) {
GeomShapePtr aShape1 = aRef1->value();
if (!aShape1.get())
aShape1 = aRef1->context()->shape();
data()->real(ConstructionPlugin_Axis::Y_DIRECTION());
AttributeDoublePtr aZAttr =
data()->real(ConstructionPlugin_Axis::Z_DIRECTION());
- if ((aRef1.get() != NULL) && (aXAttr.get() != NULL) &&
- (aYAttr.get() != NULL) && (aZAttr.get() != NULL)) {
+ if ((aRef1.get() != nullptr) && (aXAttr.get() != nullptr) &&
+ (aYAttr.get() != nullptr) && (aZAttr.get() != nullptr)) {
GeomShapePtr aShape1 = aRef1->value();
if (!aShape1.get())
aShape1 = aRef1->context()->shape();
}
}
-bool ConstructionPlugin_Axis::customisePresentation(ResultPtr theResult,
+bool ConstructionPlugin_Axis::customisePresentation(ResultPtr /*theResult*/,
AISObjectPtr thePrs) {
bool isCustomized = false;
public GeomAPI_ICustomPrs {
public:
/// Returns the kind of a feature
- CONSTRUCTIONPLUGIN_EXPORT virtual const std::string &getKind() {
+ CONSTRUCTIONPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = ConstructionPlugin_Axis::ID();
return MY_KIND;
}
inline static const double MINIMAL_LENGTH() { return 1.e-5; }
/// Creates a new part document if needed
- CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
+ CONSTRUCTIONPLUGIN_EXPORT void execute() override;
/// Request for initialization of data model of the feature: adding all
/// attributes
- CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
+ CONSTRUCTIONPLUGIN_EXPORT void initAttributes() override;
/// Use plugin manager for features creation
ConstructionPlugin_Axis();
/// Customize presentation of the feature
- virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs);
+ bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs) override;
protected:
/// Creates a new axis by two defined points
#include <Config_PropManager.h>
//==================================================================================================
-ConstructionPlugin_Point::ConstructionPlugin_Point() {}
+ConstructionPlugin_Point::ConstructionPlugin_Point() = default;
//==================================================================================================
const std::string &ConstructionPlugin_Point::getKind() {
if (!aPoints.empty()) { // if no points found produce the standard error
// later
int anIndex = 0;
- std::list<std::shared_ptr<GeomAPI_Vertex>>::iterator aPIter =
- aPoints.begin();
+ auto aPIter = aPoints.begin();
for (; aPIter != aPoints.end(); aPIter++, anIndex++) {
std::shared_ptr<ModelAPI_ResultConstruction> aConstr =
document()->createConstruction(data(), anIndex);
AISObjectPtr thePrs) {
std::vector<int> aColor;
// get color from the attribute of the result
- if (theResult.get() != NULL &&
- theResult->data()->attribute(ModelAPI_Result::COLOR_ID()).get() != NULL) {
+ if (theResult.get() != nullptr &&
+ theResult->data()->attribute(ModelAPI_Result::COLOR_ID()).get() !=
+ nullptr) {
AttributeIntArrayPtr aColorAttr =
theResult->data()->intArray(ModelAPI_Result::COLOR_ID());
if (aColorAttr.get() && aColorAttr->size()) {
public GeomAPI_ICustomPrs {
public:
/// Returns the kind of a feature.
- CONSTRUCTIONPLUGIN_EXPORT virtual const std::string &getKind();
+ CONSTRUCTIONPLUGIN_EXPORT const std::string &getKind() override;
/// Default color for a point.
inline static const std::string &DEFAULT_COLOR() {
}
/// Creates a new part document if needed.
- CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
+ CONSTRUCTIONPLUGIN_EXPORT void execute() override;
/// Request for initialization of data model of the feature: adding all
/// attributes.
- CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
+ CONSTRUCTIONPLUGIN_EXPORT void initAttributes() override;
/// Use plugin manager for features creation
ConstructionPlugin_Point();
/// Customize presentation of the feature
- virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs);
+ bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs) override;
private:
std::shared_ptr<GeomAPI_Vertex> createByXYZ();
public:
/// Constructor
/// \param theSender a pointer on sender object
- explicit Events_InfoMessage(const void *theSender = 0)
+ explicit Events_InfoMessage(const void *theSender = nullptr)
: Events_Message(Events_Loop::eventByName("InfoMessage"), theSender) {}
/// Constructor
/// \param theSender a pointer on sender object
Events_InfoMessage(const std::string &theContext, const std::string &theMsg,
- const void *theSender = 0)
+ const void *theSender = nullptr)
: Events_Message(Events_Loop::eventByName("InfoMessage"), theSender),
myContext(theContext), myMessage(theMsg) {}
/// default destructor
- virtual ~Events_InfoMessage() {}
+ ~Events_InfoMessage() override = default;
/// Identifier of this event (one for all errors)
static Events_ID errorID() {
std::map<char *, std::shared_ptr<Events_Message>> myGroups;
public:
- virtual ~Events_Listener() {}
+ virtual ~Events_Listener() = default;
//! This method is called by loop when the event is started to process.
EVENTS_EXPORT virtual void
std::set<char *> myFlushed;
/// to process flushes or not
- bool myFlushActive;
+ bool myFlushActive{true};
//! The empty constructor, will be called at startup of the application, only
//! once
- Events_Loop() : myFlushActive(true) {}
+ Events_Loop() {}
public:
///! Returns the main object of the loop, one per application.
//! is used for it)
EVENTS_EXPORT void registerListener(Events_Listener *theListener,
const Events_ID theID,
- void *theSender = 0,
+ void *theSender = nullptr,
bool theImmediate = false);
//! Remove the listener from internal maps if it was registered there
public:
//! Creates the message
- Events_Message(const Events_ID theID, const void *theSender = 0)
+ Events_Message(const Events_ID theID, const void *theSender = nullptr)
: myEventsId(theID), mySender((void *)theSender) {}
//! do nothing in the destructor yet
- virtual ~Events_Message() {}
+ virtual ~Events_Message() = default;
//! Returns identifier of the message
const Events_ID &eventID() const { return myEventsId; }
public:
//! Creates the message
- Events_MessageGroup(const Events_ID theID, const void *theSender = 0);
+ Events_MessageGroup(const Events_ID theID, const void *theSender = nullptr);
//! do nothing in the destructor yet
- virtual ~Events_MessageGroup();
+ ~Events_MessageGroup() override;
//! Creates a new empty group (to store it in the loop before flush)
virtual std::shared_ptr<Events_MessageGroup> newEmpty() = 0;
}
//==================================================================================================
-FeaturesAPI_Pipe::~FeaturesAPI_Pipe() {}
+FeaturesAPI_Pipe::~FeaturesAPI_Pipe() = default;
//==================================================================================================
void FeaturesAPI_Pipe::setBase(
/// Destructor.
FEATURESAPI_EXPORT
- virtual ~FeaturesAPI_Pipe();
+ ~FeaturesAPI_Pipe() override;
INTERFACE_5(FeaturesPlugin_Pipe::ID(), baseObjects,
FeaturesPlugin_Pipe::BASE_OBJECTS_ID(),
/// Dump wrapped feature
FEATURESAPI_EXPORT
- virtual void dump(ModelHighAPI_Dumper &theDumper) const;
+ void dump(ModelHighAPI_Dumper &theDumper) const override;
};
/// Pointer on Pipe object.
-typedef std::shared_ptr<FeaturesAPI_Pipe> PipePtr;
+using PipePtr = std::shared_ptr<FeaturesAPI_Pipe>;
/// \ingroup CPPHighAPI
/// \brief Create Pipe feature.
}
//=================================================================================================
-FeaturesAPI_Recover::~FeaturesAPI_Recover() {}
+FeaturesAPI_Recover::~FeaturesAPI_Recover() = default;
//=================================================================================================
void FeaturesAPI_Recover::setBaseFeature(
/// Destructor.
FEATURESAPI_EXPORT
- virtual ~FeaturesAPI_Recover();
+ ~FeaturesAPI_Recover() override;
INTERFACE_2(FeaturesPlugin_Recover::ID(), baseFeature,
FeaturesPlugin_Recover::BASE_FEATURE(),
/// Dump wrapped feature
FEATURESAPI_EXPORT
- virtual void dump(ModelHighAPI_Dumper &theDumper) const;
+ void dump(ModelHighAPI_Dumper &theDumper) const override;
};
/// Pointer on Recover object.
-typedef std::shared_ptr<FeaturesAPI_Recover> RecoverPtr;
+using RecoverPtr = std::shared_ptr<FeaturesAPI_Recover>;
/// \ingroup CPPHighAPI
/// \brief Create Recover feature.
}
//==================================================================================================
-FeaturesAPI_Revolution::~FeaturesAPI_Revolution() {}
+FeaturesAPI_Revolution::~FeaturesAPI_Revolution() = default;
//==================================================================================================
void FeaturesAPI_Revolution::setNestedSketch(
/// Destructor.
FEATURESAPI_EXPORT
- virtual ~FeaturesAPI_Revolution();
+ ~FeaturesAPI_Revolution() override;
INTERFACE_10(
FeaturesPlugin_Revolution::ID(), sketch,
/// Dump wrapped feature
FEATURESAPI_EXPORT
- virtual void dump(ModelHighAPI_Dumper &theDumper) const;
+ void dump(ModelHighAPI_Dumper &theDumper) const override;
private:
void execIfBaseNotEmpty();
};
/// Pointer on Revolution object.
-typedef std::shared_ptr<FeaturesAPI_Revolution> RevolutionPtr;
+using RevolutionPtr = std::shared_ptr<FeaturesAPI_Revolution>;
/// \ingroup CPPHighAPI
/// \brief Create Revolution feature.
class FeaturesPlugin_CommonSharedFaces : public ModelAPI_Feature {
public:
/// Performs the algorithm and stores results it in the data structure.
- FEATURESPLUGIN_EXPORT virtual void execute(){};
+ FEATURESPLUGIN_EXPORT void execute() override{};
/// Return Attribut values of result.
virtual AttributePtr attributObject() = 0;
virtual AttributePtr attributIsCompute() = 0;
protected:
- FeaturesPlugin_CommonSharedFaces() {}
+ FeaturesPlugin_CommonSharedFaces() = default;
// Set group of faces
void setFacesGroup(const std::wstring &theName);
}
/// Appends a feature to the sketch sub-elements container.
- FEATURESPLUGIN_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
- addFeature(std::string theID);
+ FEATURESPLUGIN_EXPORT std::shared_ptr<ModelAPI_Feature>
+ addFeature(std::string theID) override;
/// \return the number of sub-elements.
- FEATURESPLUGIN_EXPORT virtual int numberOfSubs(bool forTree = false) const;
+ FEATURESPLUGIN_EXPORT int numberOfSubs(bool forTree = false) const override;
/// \return the sub-feature by zero-base index.
- FEATURESPLUGIN_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
- subFeature(const int theIndex, bool forTree = false);
+ FEATURESPLUGIN_EXPORT std::shared_ptr<ModelAPI_Feature>
+ subFeature(const int theIndex, bool forTree = false) override;
/// \return the sub-feature unique identifier in this composite feature by
/// zero-base index.
- FEATURESPLUGIN_EXPORT virtual int subFeatureId(const int theIndex) const;
+ FEATURESPLUGIN_EXPORT int subFeatureId(const int theIndex) const override;
/// \return true if feature or result belong to this composite feature as
/// subs.
- FEATURESPLUGIN_EXPORT virtual bool isSub(ObjectPtr theObject) const;
+ FEATURESPLUGIN_EXPORT bool isSub(ObjectPtr theObject) const override;
/// This method to inform that sub-feature is removed and must be removed from
/// the internal data structures of the owner (the remove from the document
/// will be done outside just after).
- FEATURESPLUGIN_EXPORT virtual void
- removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature);
+ FEATURESPLUGIN_EXPORT void
+ removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature) override;
protected:
enum InitFlags { InitSketchLauncher = 1 << 0, InitBaseObjectsList = 1 << 1 };
- FeaturesPlugin_CompositeSketch(){};
+ FeaturesPlugin_CompositeSketch() = default;
+ ;
/// Initializes composite sketch attributes.
void initCompositeSketchAttribtues(const int theInitFlags);
#include <sstream>
//=================================================================================================
-FeaturesPlugin_GroupSharedFaces::FeaturesPlugin_GroupSharedFaces() {}
+FeaturesPlugin_GroupSharedFaces::FeaturesPlugin_GroupSharedFaces() = default;
//=================================================================================================
void FeaturesPlugin_GroupSharedFaces::initAttributes() {
}
/// \return the kind of a feature.
- virtual const std::string &getKind() { return ID(); }
+ const std::string &getKind() override { return ID(); }
/// Performs the algorithm and stores results it in the data structure.
- FEATURESPLUGIN_EXPORT virtual void execute();
+ FEATURESPLUGIN_EXPORT void execute() override;
/// Request for initialization of data model of the feature: adding all
/// attributes
- FEATURESPLUGIN_EXPORT virtual void initAttributes();
+ FEATURESPLUGIN_EXPORT void initAttributes() override;
/// Called on change of any argument-attribute of this object
/// \param theID identifier of changed attribute
- FEATURESPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ FEATURESPLUGIN_EXPORT void
+ attributeChanged(const std::string &theID) override;
/// Use plugin manager for features creation
FeaturesPlugin_GroupSharedFaces();
private:
/// Return Attribut values of object.
- virtual AttributePtr attributObject();
+ AttributePtr attributObject() override;
/// Return Attribut values of list of faces.
- virtual AttributePtr attributListFaces();
+ AttributePtr attributListFaces() override;
/// Return Attribut values of number of faces.
- virtual AttributePtr attributNumberFaces();
+ AttributePtr attributNumberFaces() override;
/// Return Attribut values of IsCompute.
- virtual AttributePtr attributIsCompute();
+ AttributePtr attributIsCompute() override;
};
#endif
}
/// \return the kind of a feature.
- FEATURESPLUGIN_EXPORT virtual const std::string &getKind() {
+ FEATURESPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = FeaturesPlugin_Pipe::ID();
return MY_KIND;
}
/// Performs the algorithm and stores results it in the data structure.
- FEATURESPLUGIN_EXPORT virtual void execute();
+ FEATURESPLUGIN_EXPORT void execute() override;
/// Request for initialization of data model of the feature: adding all
/// attributes
- FEATURESPLUGIN_EXPORT virtual void initAttributes();
+ FEATURESPLUGIN_EXPORT void initAttributes() override;
/// Use plugin manager for features creation
FeaturesPlugin_Pipe();
}
/// Returns the kind of a feature
- FEATURESPLUGIN_EXPORT virtual const std::string &getKind() {
+ FEATURESPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = FeaturesPlugin_Recover::ID();
return MY_KIND;
}
/// Performs the algorithm and stores results it in the data structure.
- FEATURESPLUGIN_EXPORT virtual void execute();
+ FEATURESPLUGIN_EXPORT void execute() override;
/// Request for initialization of data model of the feature: adding all
/// attributes
- FEATURESPLUGIN_EXPORT virtual void initAttributes();
+ FEATURESPLUGIN_EXPORT void initAttributes() override;
/// Called on change of any argument-attribute of this object
/// \param theID identifier of changed attribute
- FEATURESPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ FEATURESPLUGIN_EXPORT void
+ attributeChanged(const std::string &theID) override;
/// Use plugin manager for features creation
FeaturesPlugin_Recover();
#include <ModelAPI_AttributeSelectionList.h>
//==================================================================================================
-FeaturesPlugin_RemoveResults::FeaturesPlugin_RemoveResults() {}
+FeaturesPlugin_RemoveResults::FeaturesPlugin_RemoveResults() = default;
//==================================================================================================
void FeaturesPlugin_RemoveResults::initAttributes() {
}
/// \return the kind of a feature.
- FEATURESPLUGIN_EXPORT virtual const std::string &getKind() {
+ FEATURESPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = FeaturesPlugin_RemoveResults::ID();
return MY_KIND;
}
/// Request for initialization of data model of the feature: adding all
/// attributes.
- FEATURESPLUGIN_EXPORT virtual void initAttributes();
+ FEATURESPLUGIN_EXPORT void initAttributes() override;
/// Does nothing, has no results.
- FEATURESPLUGIN_EXPORT virtual void execute() {}
+ FEATURESPLUGIN_EXPORT void execute() override {}
/// Hidden from the user.
- FEATURESPLUGIN_EXPORT virtual bool isInHistory() { return false; }
+ FEATURESPLUGIN_EXPORT bool isInHistory() override { return false; }
};
#endif
#include <GeomAlgoAPI_ShapeTools.h>
//==================================================================================================
-FeaturesPlugin_RemoveSubShapes::FeaturesPlugin_RemoveSubShapes()
- : myChangedInCode(false) {}
+FeaturesPlugin_RemoveSubShapes::FeaturesPlugin_RemoveSubShapes() {}
//==================================================================================================
void FeaturesPlugin_RemoveSubShapes::initAttributes() {
std::list<GeomShapePtr> aSubShapes =
GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
- ListOfShape::const_iterator anIt = aSubShapes.cbegin();
+ auto anIt = aSubShapes.cbegin();
for (; anIt != aSubShapes.cend(); ++anIt) {
GeomShapePtr aSubShape = *anIt;
if (!isHasSubs) {
aSubShapesToKeepAttrList->append(aContext, aSubShape);
} else {
- std::list<ResultPtr>::iterator aSubsIt = anAllSubs.begin();
+ auto aSubsIt = anAllSubs.begin();
for (; aSubsIt != anAllSubs.end(); aSubsIt++) {
ResultBodyPtr aSub =
std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aSubsIt);
std::list<GeomShapePtr> aSubShapes =
GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
- ListOfShape::const_iterator anIt = aSubShapes.cbegin();
+ auto anIt = aSubShapes.cbegin();
for (; anIt != aSubShapes.cend(); ++anIt) {
GeomShapePtr aSubShape = *anIt;
if (aSubShapesToKeep.isBound(aSubShape))
if (!isHasSubs) {
aSubShapesToRemoveAttrList->append(aContext, aSubShape);
} else {
- std::list<ResultPtr>::iterator aSubsIt = anAllSubs.begin();
+ auto aSubsIt = anAllSubs.begin();
for (; aSubsIt != anAllSubs.end(); aSubsIt++) {
ResultBodyPtr aSub =
std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aSubsIt);
std::list<GeomShapePtr> aSubShapes =
GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
- ListOfShape::const_iterator anIt = aSubShapes.cbegin();
+ auto anIt = aSubShapes.cbegin();
for (; anIt != aSubShapes.cend(); ++anIt) {
GeomShapePtr aSubShape = *anIt;
if (aSubShapesToRemove.isBound(aSubShape))
if (!isHasSubs) {
aSubShapesToKeepAttrList->append(aContext, aSubShape);
} else {
- std::list<ResultPtr>::iterator aSubsIt = anAllSubs.begin();
+ auto aSubsIt = anAllSubs.begin();
for (; aSubsIt != anAllSubs.end(); aSubsIt++) {
ResultBodyPtr aSub =
std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aSubsIt);
std::list<GeomShapePtr> aSubShapes =
GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
- for (ListOfShape::const_iterator anIt = aSubShapes.cbegin();
- anIt != aSubShapes.cend(); ++anIt) {
- GeomShapePtr aSubShape = *anIt;
+ for (auto aSubShape : aSubShapes) {
if (!aSubShape.get() || aSubShape->isNull())
continue;
std::list<GeomShapePtr> anOldShapes;
anOldShapes.push_back(aBaseShape);
aResultBody->storeModified(anOldShapes, aResultShape, aMakeShapeList);
- for (std::set<GeomAPI_Shape::ShapeType>::iterator aTypeIter = aTypes.begin();
- aTypeIter != aTypes.end(); ++aTypeIter) {
- aResultBody->loadDeletedShapes(aMakeShapeList, aBaseShape, *aTypeIter);
+ for (auto aType : aTypes) {
+ aResultBody->loadDeletedShapes(aMakeShapeList, aBaseShape, aType);
}
aResultBody->loadModifiedShapes(aMakeShapeList, aBaseShape,
}
/// \return the kind of a feature.
- FEATURESPLUGIN_EXPORT virtual const std::string &getKind() {
+ FEATURESPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = FeaturesPlugin_RemoveSubShapes::ID();
return MY_KIND;
}
/// Request for initialization of data model of the feature: adding all
/// attributes.
- FEATURESPLUGIN_EXPORT virtual void initAttributes();
+ FEATURESPLUGIN_EXPORT void initAttributes() override;
/// Called on change of any argument-attribute of this object.
/// \param[in] theID identifier of changed attribute.
- FEATURESPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ FEATURESPLUGIN_EXPORT void
+ attributeChanged(const std::string &theID) override;
/// Performs the algorithm and stores results it in the data structure.
- FEATURESPLUGIN_EXPORT virtual void execute();
+ FEATURESPLUGIN_EXPORT void execute() override;
private:
- bool myChangedInCode;
+ bool myChangedInCode{false};
};
#endif
}
/// \return the kind of a feature.
- FEATURESPLUGIN_EXPORT virtual const std::string &getKind() {
+ FEATURESPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = FeaturesPlugin_Revolution::ID();
return MY_KIND;
}
/// Performs the algorithm and stores results it in the data structure.
- FEATURESPLUGIN_EXPORT virtual void execute();
+ FEATURESPLUGIN_EXPORT void execute() override;
/// Request for initialization of data model of the feature: adding all
/// attributes.
- FEATURESPLUGIN_EXPORT virtual void initAttributes();
+ FEATURESPLUGIN_EXPORT void initAttributes() override;
/// Use plugin manager for features creation.
FeaturesPlugin_Revolution();
if (theShape->isVertex()) {
GeomPointPtr aPnt = theShape->vertex()->point();
- for (std::list<GeomLinePtr>::iterator anIt = aLines.begin();
- anIt != aLines.end(); ++anIt) {
- if ((*anIt)->contains(aPnt))
+ for (auto &aLine : aLines) {
+ if (aLine->contains(aPnt))
return true;
}
} else if (theShape->isEdge()) {
if (aEdge->isLine()) {
GeomPointPtr aPnt1 = aEdge->firstPoint();
GeomPointPtr aPnt2 = aEdge->lastPoint();
- for (std::list<GeomLinePtr>::iterator anIt = aLines.begin();
- anIt != aLines.end(); ++anIt) {
- if ((*anIt)->contains(aPnt1) && (*anIt)->contains(aPnt2))
+ for (auto &aLine : aLines) {
+ if (aLine->contains(aPnt1) && aLine->contains(aPnt2))
return true;
}
}
public:
FiltersPlugin_OnLine() : ModelAPI_Filter() {}
- virtual const std::string &name() const {
+ const std::string &name() const override {
static const std::string kName("On line");
return kName;
}
/// Returns true for any type because it supports all selection types
- virtual bool isSupported(GeomAPI_Shape::ShapeType theType) const override;
+ bool isSupported(GeomAPI_Shape::ShapeType theType) const override;
/// Returns True if the filter can be used several times within one selection
- virtual bool isMultiple() const { return true; }
+ bool isMultiple() const override { return true; }
/// This method should contain the filter logic. It returns true if the given
/// shape is accepted by the filter. \param theShape the given shape \param
/// theArgs arguments of the filter
- virtual bool isOk(const GeomShapePtr &theShape, const ResultPtr &,
- const ModelAPI_FiltersArgs &theArgs) const override;
+ bool isOk(const GeomShapePtr &theShape, const ResultPtr &,
+ const ModelAPI_FiltersArgs &theArgs) const override;
/// Returns XML string which represents GUI of the filter
- virtual std::string xmlRepresentation() const override;
+ std::string xmlRepresentation() const override;
/// Initializes arguments of a filter.
- virtual void initAttributes(ModelAPI_FiltersArgs &theArguments) override;
+ void initAttributes(ModelAPI_FiltersArgs &theArguments) override;
};
#endif
GeomAPI_AISObject();
GEOMAPI_EXPORT
- ~GeomAPI_AISObject();
+ ~GeomAPI_AISObject() override;
/// \brief Creates AIS_Shape object using specified shape
GEOMAPI_EXPORT
};
//! Pointer on attribute object
-typedef std::shared_ptr<GeomAPI_AISObject> AISObjectPtr;
+using AISObjectPtr = std::shared_ptr<GeomAPI_AISObject>;
#endif
};
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_Ax3> GeomAx3Ptr;
+using GeomAx3Ptr = std::shared_ptr<GeomAPI_Ax3>;
#endif
class GeomAPI_BSpline;
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_BSpline> GeomBSplinePtr;
+using GeomBSplinePtr = std::shared_ptr<GeomAPI_BSpline>;
/**\class GeomAPI_BSpline
* \ingroup DataModel
}
//=================================================================================================
-const bool GeomAPI_Circ::parameter(const std::shared_ptr<GeomAPI_Pnt> thePoint,
- const double theTolerance,
- double &theParameter) const {
+bool GeomAPI_Circ::parameter(const std::shared_ptr<GeomAPI_Pnt> thePoint,
+ const double theTolerance,
+ double &theParameter) const {
Handle(Geom_Circle) aCurve = new Geom_Circle(*MY_CIRC);
return GeomLib_Tool::Parameter(aCurve, thePoint->impl<gp_Pnt>(), theTolerance,
theParameter) == Standard_True;
* theTolerance tolerance of computation. \param[out] theParameter resulting
* parameter.
*/
- GEOMAPI_EXPORT const bool
- parameter(const std::shared_ptr<GeomAPI_Pnt> thePoint,
- const double theTolerance, double &theParameter) const;
+ GEOMAPI_EXPORT bool parameter(const std::shared_ptr<GeomAPI_Pnt> thePoint,
+ const double theTolerance,
+ double &theParameter) const;
};
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_Circ> GeomCirclePtr;
+using GeomCirclePtr = std::shared_ptr<GeomAPI_Circ>;
#endif
};
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_Curve> GeomCurvePtr;
+using GeomCurvePtr = std::shared_ptr<GeomAPI_Curve>;
#endif
public:
class iterator {
public:
- typedef GeomShapePtr key_type;
- typedef ListOfShape mapped_type;
- typedef std::pair<GeomShapePtr, ListOfShape> value_type;
+ using key_type = GeomShapePtr;
+ using mapped_type = ListOfShape;
+ using value_type = std::pair<GeomShapePtr, ListOfShape>;
public:
GEOMAPI_EXPORT iterator();
std::shared_ptr<iterator> mySelf;
};
- typedef iterator const_iterator;
+ using const_iterator = iterator;
GEOMAPI_EXPORT iterator begin();
GEOMAPI_EXPORT const_iterator begin() const;
/// Destructor
GEOMAPI_EXPORT
- ~GeomAPI_DataMapOfShapeShape();
+ ~GeomAPI_DataMapOfShapeShape() override;
};
#endif
};
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_Dir> GeomDirPtr;
+using GeomDirPtr = std::shared_ptr<GeomAPI_Dir>;
#endif
/// Returns \c true if edges have same underlying curve
GEOMAPI_EXPORT
- virtual bool
- isSameGeometry(const std::shared_ptr<GeomAPI_Shape> theShape) const;
+ bool
+ isSameGeometry(const std::shared_ptr<GeomAPI_Shape> theShape) const override;
/// Verifies that the edge is a line
GEOMAPI_EXPORT
/// Returns true if the current edge is geometrically equal to the given edge
GEOMAPI_EXPORT
- bool isEqual(const std::shared_ptr<GeomAPI_Shape> theEdge) const;
+ bool isEqual(const std::shared_ptr<GeomAPI_Shape> theEdge) const override;
/// Change parametric range of the curve
GEOMAPI_EXPORT
/// Return middle point on the edge
GEOMAPI_EXPORT
- virtual std::shared_ptr<GeomAPI_Pnt> middlePoint() const;
+ std::shared_ptr<GeomAPI_Pnt> middlePoint() const override;
};
//! Pointer on object
-typedef std::shared_ptr<GeomAPI_Edge> GeomEdgePtr;
+using GeomEdgePtr = std::shared_ptr<GeomAPI_Edge>;
#endif
};
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_Ellipse> GeomEllipsePtr;
+using GeomEllipsePtr = std::shared_ptr<GeomAPI_Ellipse>;
#endif
/// Returns true if the current face is geometrically equal to the given face
GEOMAPI_EXPORT
- virtual bool isEqual(const std::shared_ptr<GeomAPI_Shape> theFace) const;
+ bool isEqual(const std::shared_ptr<GeomAPI_Shape> theFace) const override;
/// Returns \c true if faces have same underlying surface
GEOMAPI_EXPORT
- virtual bool
- isSameGeometry(const std::shared_ptr<GeomAPI_Shape> theShape) const;
+ bool
+ isSameGeometry(const std::shared_ptr<GeomAPI_Shape> theShape) const override;
/// Returns true if the face is a cylindrical face
GEOMAPI_EXPORT
GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Torus> getTorus() const;
/// Return inner point in the face
- GEOMAPI_EXPORT virtual std::shared_ptr<GeomAPI_Pnt> middlePoint() const;
+ GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt> middlePoint() const override;
};
//! Pointer on attribute object
-typedef std::shared_ptr<GeomAPI_Face> GeomFacePtr;
+using GeomFacePtr = std::shared_ptr<GeomAPI_Face>;
#endif
AISObjectPtr thePrs) = 0;
};
-typedef std::shared_ptr<GeomAPI_ICustomPrs> GeomCustomPrsPtr;
+using GeomCustomPrsPtr = std::shared_ptr<GeomAPI_ICustomPrs>;
#endif
virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious) = 0;
};
-typedef std::shared_ptr<GeomAPI_IPresentable> GeomPresentablePtr;
+using GeomPresentablePtr = std::shared_ptr<GeomAPI_IPresentable>;
#endif
};
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_Lin> GeomLinePtr;
+using GeomLinePtr = std::shared_ptr<GeomAPI_Lin>;
#endif
};
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_Lin2d> GeomLine2dPtr;
+using GeomLine2dPtr = std::shared_ptr<GeomAPI_Lin2d>;
#endif
};
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_Pln> GeomPlanePtr;
+using GeomPlanePtr = std::shared_ptr<GeomAPI_Pln>;
#endif
};
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_Pnt> GeomPointPtr;
+using GeomPointPtr = std::shared_ptr<GeomAPI_Pnt>;
#endif
};
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_Pnt2d> GeomPnt2dPtr;
+using GeomPnt2dPtr = std::shared_ptr<GeomAPI_Pnt2d>;
#endif
};
//! Pointer on list of shapes
-typedef std::list<std::shared_ptr<GeomAPI_Shape>> ListOfShape;
+using ListOfShape = std::list<std::shared_ptr<GeomAPI_Shape>>;
//! Pointer on attribute object
-typedef std::shared_ptr<GeomAPI_Shape> GeomShapePtr;
+using GeomShapePtr = std::shared_ptr<GeomAPI_Shape>;
#endif
/// Returns true if the current edge is geometrically equal to the given edge.
GEOMAPI_EXPORT
- virtual bool isEqual(const std::shared_ptr<GeomAPI_Shape> theVert) const;
+ bool isEqual(const std::shared_ptr<GeomAPI_Shape> theVert) const override;
public:
/// \brief Compare vertices geometrically
};
//! Pointer on the object
-typedef std::shared_ptr<GeomAPI_Vertex> GeomVertexPtr;
+using GeomVertexPtr = std::shared_ptr<GeomAPI_Vertex>;
#endif
isRectangle(std::list<std::shared_ptr<GeomAPI_Pnt>> &thePoints) const;
/// Return middle point on the wire
- GEOMAPI_EXPORT virtual std::shared_ptr<GeomAPI_Pnt> middlePoint() const;
+ GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt> middlePoint() const override;
};
-typedef std::shared_ptr<GeomAPI_Wire> GeomWirePtr;
+using GeomWirePtr = std::shared_ptr<GeomAPI_Wire>;
#endif
};
//! Pointer on object
-typedef std::shared_ptr<GeomAPI_XYZ> GeomXYZPtr;
+using GeomXYZPtr = std::shared_ptr<GeomAPI_XYZ>;
#endif
#include <GeomAlgoAPI_MakeShape.h>
#include <GeomAPI_Shape.h>
-//#include <GeomAPI_Edge.h>
-//#include <GeomAPI_Face.h>
+// #include <GeomAPI_Edge.h>
+// #include <GeomAPI_Face.h>
/// \class GeomAlgoAPI_Chamfer
/// \ingroup DataAlgo
if (!theBaseSolid || theFacesToRemove.empty())
return;
- BRepAlgoAPI_Defeaturing *aDefeaturing = new BRepAlgoAPI_Defeaturing;
+ auto *aDefeaturing = new BRepAlgoAPI_Defeaturing;
aDefeaturing->SetShape(theBaseSolid->impl<TopoDS_Shape>());
aDefeaturing->SetRunParallel(Standard_True);
// collect faces to remove
TopTools_ListOfShape aFaces;
- for (ListOfShape::const_iterator anIt = theFacesToRemove.begin();
- anIt != theFacesToRemove.end(); ++anIt)
- aDefeaturing->AddFaceToRemove((*anIt)->impl<TopoDS_Shape>());
+ for (const auto &anIt : theFacesToRemove)
+ aDefeaturing->AddFaceToRemove(anIt->impl<TopoDS_Shape>());
setImpl(aDefeaturing);
setBuilderType(OCCT_BRepBuilderAPI_MakeShape);
/// \ingroup DataAlgo
/// \brief Perform fillet on vertices of a wire
class GeomAlgoAPI_Fillet1D : public GeomAlgoAPI_MakeShape {
- typedef std::map<GeomShapePtr, ListOfShape, GeomAPI_Shape::Comparator>
- MapModified;
+ using MapModified =
+ std::map<GeomShapePtr, ListOfShape, GeomAPI_Shape::Comparator>;
public:
/// Run fillet operation on a set of vertices with fixed radius.
/// \param[in] theOldShape base shape.
/// \param[out] theNewShapes shapes generated from \a theShape. Does not
/// cleared!
- GEOMALGOAPI_EXPORT virtual void generated(const GeomShapePtr theOldShape,
- ListOfShape &theNewShapes);
+ GEOMALGOAPI_EXPORT void generated(const GeomShapePtr theOldShape,
+ ListOfShape &theNewShapes) override;
/// \return the list of shapes modified from the shape \a theShape.
/// \param[in] theOldShape base shape.
/// \param[out] theNewShapes shapes modified from \a theShape. Does not
/// cleared!
- GEOMALGOAPI_EXPORT virtual void modified(const GeomShapePtr theOldShape,
- ListOfShape &theNewShapes);
+ GEOMALGOAPI_EXPORT void modified(const GeomShapePtr theOldShape,
+ ListOfShape &theNewShapes) override;
/// \return List of failed vertices
const ListOfShape &failedVertices() const { return myFailedVertices; }
static void edgesToCurves(const std::list<GeomEdgePtr> &theEdges,
std::list<Handle(Geom_Curve)> &theCurves) {
- for (std::list<GeomEdgePtr>::const_iterator anIt = theEdges.begin();
- anIt != theEdges.end(); ++anIt) {
- const TopoDS_Edge &anEdge = (*anIt)->impl<TopoDS_Edge>();
+ for (const auto &theEdge : theEdges) {
+ const auto &anEdge = theEdge->impl<TopoDS_Edge>();
if (BRep_Tool::Degenerated(anEdge))
continue;
// obtain section curves
std::list<Handle(Geom_Curve)> aCurves;
edgesToCurves(myConstraints, aCurves);
- for (std::list<Handle(Geom_Curve)>::iterator anIt = aCurves.begin();
- anIt != aCurves.end(); ++anIt)
- aSection.AddCurve(*anIt);
+ for (auto &aCurve : aCurves)
+ aSection.AddCurve(aCurve);
// a 'tolerance' is used to compare 2 knots
aSection.Perform(Precision::PConfusion());
// compute maximal number of poles in B-spline curves
int aMaxPoles = 0;
- std::list<Handle(Geom_Curve)>::iterator anIt = aCurves.begin();
+ auto anIt = aCurves.begin();
for (; anIt != aCurves.end(); ++anIt) {
Handle(Geom_BSplineCurve) aBC =
Handle(Geom_BSplineCurve)::DownCast(removeTrim(*anIt));
#include <TopoDS_Edge.hxx>
// new shape -> old shapes -> index in the old shape
-typedef NCollection_DataMap<
+using MapNewToOld = NCollection_DataMap<
TopoDS_Shape,
NCollection_DataMap<TopoDS_Shape, int, TopTools_ShapeMapHasher>,
- TopTools_ShapeMapHasher>
- MapNewToOld;
-typedef NCollection_DataMap<int, NCollection_DataMap<TopoDS_Shape, MapNewToOld,
- TopTools_ShapeMapHasher>>
- HistoryMap;
+ TopTools_ShapeMapHasher>;
+using HistoryMap =
+ NCollection_DataMap<int, NCollection_DataMap<TopoDS_Shape, MapNewToOld,
+ TopTools_ShapeMapHasher>>;
//==================================================================================================
-GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape()
- : myBuilderType(Unknown), myDone(false) {
- myHist = 0;
-}
+GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape() { myHist = nullptr; }
//==================================================================================================
GeomAlgoAPI_MakeShape::~GeomAlgoAPI_MakeShape() {
ListOfShape &theNewShapes) {
TopTools_ListOfShape aList;
if (myBuilderType == OCCT_BRepBuilderAPI_MakeShape) {
- BRepBuilderAPI_MakeShape *aMakeShape = implPtr<BRepBuilderAPI_MakeShape>();
+ auto *aMakeShape = implPtr<BRepBuilderAPI_MakeShape>();
aList = aMakeShape->Generated(theOldShape->impl<TopoDS_Shape>());
} else if (myBuilderType == OCCT_BOPAlgo_Builder) {
- BOPAlgo_Builder *aBOPBuilder = implPtr<BOPAlgo_Builder>();
+ auto *aBOPBuilder = implPtr<BOPAlgo_Builder>();
aList = aBOPBuilder->Generated(theOldShape->impl<TopoDS_Shape>());
}
for (TopTools_ListIteratorOfListOfShape anIt(aList); anIt.More();
ListOfShape &theNewShapes) {
TopTools_ListOfShape aList;
if (myBuilderType == OCCT_BRepBuilderAPI_MakeShape) {
- BRepBuilderAPI_MakeShape *aMakeShape = implPtr<BRepBuilderAPI_MakeShape>();
+ auto *aMakeShape = implPtr<BRepBuilderAPI_MakeShape>();
try {
aList = aMakeShape->Modified(theOldShape->impl<TopoDS_Shape>());
} catch (Standard_NoSuchObject) {
}
} else if (myBuilderType == OCCT_BOPAlgo_Builder) {
- BOPAlgo_Builder *aBOPBuilder = implPtr<BOPAlgo_Builder>();
+ auto *aBOPBuilder = implPtr<BOPAlgo_Builder>();
aList = aBOPBuilder->Modified(theOldShape->impl<TopoDS_Shape>());
}
for (TopTools_ListIteratorOfListOfShape anIt(aList); anIt.More();
bool GeomAlgoAPI_MakeShape::isDeleted(const GeomShapePtr theOldShape) {
bool isDeleted = false;
if (myBuilderType == OCCT_BRepBuilderAPI_MakeShape) {
- BRepBuilderAPI_MakeShape *aMakeShape = implPtr<BRepBuilderAPI_MakeShape>();
+ auto *aMakeShape = implPtr<BRepBuilderAPI_MakeShape>();
isDeleted = aMakeShape->IsDeleted(theOldShape->impl<TopoDS_Shape>()) ==
Standard_True;
} else if (myBuilderType == OCCT_BOPAlgo_Builder) {
- BOPAlgo_Builder *aBOPBuilder = implPtr<BOPAlgo_Builder>();
+ auto *aBOPBuilder = implPtr<BOPAlgo_Builder>();
isDeleted = aBOPBuilder->IsDeleted(theOldShape->impl<TopoDS_Shape>()) ==
Standard_True;
}
myMap.reset(new GeomAPI_DataMapOfShapeShape);
}
- const TopoDS_Shape &aTopoDSShape = myShape->impl<TopoDS_Shape>();
+ const auto &aTopoDSShape = myShape->impl<TopoDS_Shape>();
for (TopExp_Explorer anExp(aTopoDSShape, TopAbs_VERTEX); anExp.More();
anExp.Next()) {
GeomShapePtr aCurrentShape(new GeomAPI_Shape());
if (!theShape.get())
return false;
- const TopoDS_Shape &aShape_ = theShape->impl<TopoDS_Shape>();
+ const auto &aShape_ = theShape->impl<TopoDS_Shape>();
if (aShape_.IsNull())
return false;
myMap.reset(new GeomAPI_DataMapOfShapeShape);
}
- const TopoDS_Shape &aTopoDSShape = myShape->impl<TopoDS_Shape>();
+ const auto &aTopoDSShape = myShape->impl<TopoDS_Shape>();
for (TopExp_Explorer anExp(aTopoDSShape, TopAbs_FACE); anExp.More();
anExp.Next()) {
GeomShapePtr aCurrentShape(new GeomAPI_Shape());
aCurrentShape->setImpl(new TopoDS_Shape(anExp.Current()));
myMap->bind(aCurrentShape, aCurrentShape);
}
- myHist = 0;
+ myHist = nullptr;
}
//==================================================================================================
const int theShapeType) {
if (!myHist)
return false;
- HistoryMap *aHist = (HistoryMap *)myHist;
+ auto *aHist = (HistoryMap *)myHist;
if (!aHist->IsBound(theShapeType))
return false;
return aHist->Find(theShapeType).IsBound(theWholeOld->impl<TopoDS_Shape>());
const int theShapeType) {
if (!myHist)
myHist = new HistoryMap;
- HistoryMap *aHist = (HistoryMap *)myHist;
+ auto *aHist = (HistoryMap *)myHist;
if (!aHist->IsBound(theShapeType))
aHist->Bind(theShapeType, NCollection_DataMap<TopoDS_Shape, MapNewToOld,
TopTools_ShapeMapHasher>());
continue;
aNewList.clear();
modified(anExp.current(), aNewList);
- for (ListOfShape::iterator aNew = aNewList.begin(); aNew != aNewList.end();
- aNew++) {
- const TopoDS_Shape &aNewShape = (*aNew)->impl<TopoDS_Shape>();
+ for (auto &aNew : aNewList) {
+ const auto &aNewShape = aNew->impl<TopoDS_Shape>();
if (!aCurrent.IsBound(aNewShape)) {
aCurrent.Bind(
aNewShape,
aBuilder.MakeCompound(aResComp);
aResult->setImpl<TopoDS_Shape>(new TopoDS_Shape(aResComp));
- HistoryMap *aHist = (HistoryMap *)myHist;
+ auto *aHist = (HistoryMap *)myHist;
if (!aHist->IsBound(theShapeType))
return aResult; // not found, empty compound
- const TopoDS_Shape &aWholeOld = theWholeOld->impl<TopoDS_Shape>();
+ const auto &aWholeOld = theWholeOld->impl<TopoDS_Shape>();
if (!aHist->Find(theShapeType).IsBound(aWholeOld))
return aResult; // not found, empty compound
std::map<int, TopoDS_Shape>
// theShapeType, so, iterate all
addAllSubs(theNewShape->impl<TopoDS_Shape>(), aCurrent, aResMap);
- std::map<int, TopoDS_Shape>::iterator anOldIter = aResMap.begin();
+ auto anOldIter = aResMap.begin();
for (; anOldIter != aResMap.end(); anOldIter++) {
if (anOldIter->second.ShapeType() == (TopAbs_ShapeEnum)theShapeType)
aBuilder.Add(aResComp, anOldIter->second);
GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape();
/// Destructor for remove myHist
- GEOMALGOAPI_EXPORT ~GeomAlgoAPI_MakeShape();
+ GEOMALGOAPI_EXPORT ~GeomAlgoAPI_MakeShape() override;
/// \brief Constructor by builder and builder type.
/// \param[in] theBuilder pointer to the builder.
void initialize();
private:
- GeomAlgoAPI_MakeShape::BuilderType
- myBuilderType; ///< Type of make shape builder.
- bool myDone; ///< Builder status.
+ GeomAlgoAPI_MakeShape::BuilderType myBuilderType{
+ Unknown}; ///< Type of make shape builder.
+ bool myDone{false}; ///< Builder status.
GeomShapePtr myShape; ///< Resulting shape.
/// map that is used to keep the optimization structure for access to the
void *myHist;
};
-typedef std::shared_ptr<GeomAlgoAPI_MakeShape> GeomMakeShapePtr;
-typedef std::list<GeomMakeShapePtr> ListOfMakeShape;
+using GeomMakeShapePtr = std::shared_ptr<GeomAlgoAPI_MakeShape>;
+using ListOfMakeShape = std::list<GeomMakeShapePtr>;
#endif
/// \return the list of shapes generated from the shape theShape
GEOMALGOAPI_EXPORT void generated(const GeomShapePtr theOldShape,
- ListOfShape &theNewShapes);
+ ListOfShape &theNewShapes) override;
/// \return the list of shapes modified from the shape theShape
GEOMALGOAPI_EXPORT void modified(const GeomShapePtr theShape,
- ListOfShape &theNewShapes);
+ ListOfShape &theNewShapes) override;
/// \return whether the shape is deleted
- GEOMALGOAPI_EXPORT bool isDeleted(const GeomShapePtr theOldShape);
+ GEOMALGOAPI_EXPORT bool isDeleted(const GeomShapePtr theOldShape) override;
private:
GeomAPI_DataMapOfShapeMapOfShapes myGenerated;
GEOMALGOAPI_EXPORT void appendAlgo(const GeomMakeShapePtr theMakeShape);
/// \return a shape built by the shape construction algorithms
- GEOMALGOAPI_EXPORT virtual const GeomShapePtr shape() const;
+ GEOMALGOAPI_EXPORT const GeomShapePtr shape() const override;
/// \return the list of shapes generated from the shape \a theShape
- GEOMALGOAPI_EXPORT virtual void generated(const GeomShapePtr theShape,
- ListOfShape &theHistory);
+ GEOMALGOAPI_EXPORT void generated(const GeomShapePtr theShape,
+ ListOfShape &theHistory) override;
/// \return the list of shapes modified from the shape \a theShape
- GEOMALGOAPI_EXPORT virtual void modified(const GeomShapePtr theShape,
- ListOfShape &theHistory);
+ GEOMALGOAPI_EXPORT void modified(const GeomShapePtr theShape,
+ ListOfShape &theHistory) override;
/// \return whether the shape is deleted
- GEOMALGOAPI_EXPORT virtual bool isDeleted(const GeomShapePtr theShape);
+ GEOMALGOAPI_EXPORT bool isDeleted(const GeomShapePtr theShape) override;
private:
void result(const GeomShapePtr theShape, ListOfShape &theHistory);
#include <map>
#include <set>
-typedef std::set<GeomShapePtr, GeomAPI_Shape::ComparatorWithOri> SetOfShapes;
-typedef std::map<GeomShapePtr, SetOfShapes, GeomAPI_Shape::Comparator>
- MapShapeToShapes;
+using SetOfShapes = std::set<GeomShapePtr, GeomAPI_Shape::ComparatorWithOri>;
+using MapShapeToShapes =
+ std::map<GeomShapePtr, SetOfShapes, GeomAPI_Shape::Comparator>;
/// \class GeomAlgoAPI_MapShapesAndAncestors
/// \ingroup DataAlgo
/// \param[in] theOldShape base shape.
/// \param[out] theNewShapes shapes generated from \a theShape. Does not
/// cleared!
- GEOMALGOAPI_EXPORT virtual void generated(const GeomShapePtr theOldShape,
- ListOfShape &theNewShapes);
+ GEOMALGOAPI_EXPORT void generated(const GeomShapePtr theOldShape,
+ ListOfShape &theNewShapes) override;
private:
/// \brief Perform offset operation
/// \param[in] theShape base shape.
/// \param[out] theHistory generated shapes.
GEOMALGOAPI_EXPORT void generated(const GeomShapePtr theShape,
- ListOfShape &theHistory);
+ ListOfShape &theHistory) override;
private:
void build(const GeomShapePtr theBaseShape, const GeomShapePtr thePathShape);
intersect(const std::shared_ptr<GeomAPI_Edge> theEdge,
const std::shared_ptr<GeomAPI_Face> theFace);
- typedef std::map<std::shared_ptr<GeomAPI_Pnt>,
- std::pair<std::list<std::shared_ptr<GeomDataAPI_Point2D>>,
- std::list<std::shared_ptr<ModelAPI_Object>>>>
- PointToRefsMap;
+ using PointToRefsMap =
+ std::map<std::shared_ptr<GeomAPI_Pnt>,
+ std::pair<std::list<std::shared_ptr<GeomDataAPI_Point2D>>,
+ std::list<std::shared_ptr<ModelAPI_Object>>>>;
/// \brief Performs the split of the shape by points.
/// \param[in] theBaseShape shape that should be divided.
/// \param[in] thePoints container of points to split
const double theThetaMin, const double theThetaMax);
/// Checks if data for the sphere construction is OK.
- GEOMALGOAPI_EXPORT bool check();
+ GEOMALGOAPI_EXPORT bool check() override;
/// Builds the sphere.
- GEOMALGOAPI_EXPORT void build();
+ GEOMALGOAPI_EXPORT void build() override;
/// Builds the sphere.
GEOMALGOAPI_EXPORT void buildRootSphere();
#include <GeomAlgoAPI.h>
#include <GeomAlgoAPI_Boolean.h>
#include <GeomAlgoAPI_Prism.h>
-//#include <GeomAlgoAPI_Tools.h>
+// #include <GeomAlgoAPI_Tools.h>
#include <GeomAPI_Shape.h>
// function :
// purpose :
//=======================================================================
-GEOMAlgo_BndSphereTreeSelector::GEOMAlgo_BndSphereTreeSelector() {}
+GEOMAlgo_BndSphereTreeSelector::GEOMAlgo_BndSphereTreeSelector() = default;
//=======================================================================
// function : ~
// purpose :
//=======================================================================
-GEOMAlgo_BndSphereTreeSelector::~GEOMAlgo_BndSphereTreeSelector() {}
+GEOMAlgo_BndSphereTreeSelector::~GEOMAlgo_BndSphereTreeSelector() = default;
//=======================================================================
// function : Reject
// purpose :
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
-typedef NCollection_UBTree<Standard_Integer, GEOMAlgo_BndSphere>
- GEOMAlgo_BndSphereTree;
+using GEOMAlgo_BndSphereTree =
+ NCollection_UBTree<Standard_Integer, GEOMAlgo_BndSphere>;
class GEOMAlgo_BndSphereTreeSelector : public GEOMAlgo_BndSphereTree::Selector {
public:
GEOMALGOIMPL_EXPORT GEOMAlgo_BndSphereTreeSelector();
- GEOMALGOIMPL_EXPORT virtual Standard_Boolean
- Reject(const GEOMAlgo_BndSphere &) const;
- GEOMALGOIMPL_EXPORT virtual Standard_Boolean Accept(const Standard_Integer &);
- GEOMALGOIMPL_EXPORT virtual ~GEOMAlgo_BndSphereTreeSelector();
+ GEOMALGOIMPL_EXPORT Standard_Boolean
+ Reject(const GEOMAlgo_BndSphere &) const override;
+ GEOMALGOIMPL_EXPORT Standard_Boolean
+ Accept(const Standard_Integer &) override;
+ GEOMALGOIMPL_EXPORT ~GEOMAlgo_BndSphereTreeSelector() override;
GEOMALGOIMPL_EXPORT void Clear();
GEOMALGOIMPL_EXPORT void SetBox(const GEOMAlgo_BndSphere &);
// function : ~
// purpose :
//=======================================================================
-GEOMAlgo_BuilderShape::~GEOMAlgo_BuilderShape() {}
+GEOMAlgo_BuilderShape::~GEOMAlgo_BuilderShape() = default;
//=======================================================================
// function : Shape
// purpose :
GEOMAlgo_BuilderShape();
GEOMALGOIMPL_EXPORT
- virtual ~GEOMAlgo_BuilderShape();
+ ~GEOMAlgo_BuilderShape() override;
//! Prepare information for history support <br>
GEOMALGOIMPL_EXPORT
// function : ~GEOMAlgo_GluerAlgo
// purpose :
//=======================================================================
-GEOMAlgo_GluerAlgo::~GEOMAlgo_GluerAlgo() {}
+GEOMAlgo_GluerAlgo::~GEOMAlgo_GluerAlgo() = default;
//=======================================================================
// function : SetArgument
// purpose :
static std::string typeId() { return std::string("Dir"); }
/// Returns the type of this class of attributes, not static method
- GEOMDATAAPI_EXPORT virtual std::string attributeType();
+ GEOMDATAAPI_EXPORT std::string attributeType() override;
protected:
/// Objects are created for features automatically
GEOMDATAAPI_EXPORT GeomDataAPI_Dir();
- GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Dir();
+ GEOMDATAAPI_EXPORT ~GeomDataAPI_Dir() override;
};
//! Pointer on attribute object
-typedef std::shared_ptr<GeomDataAPI_Dir> AttributeDirPtr;
+using AttributeDirPtr = std::shared_ptr<GeomDataAPI_Dir>;
#endif
std::string GeomDataAPI_Point::attributeType() { return typeId(); }
-GeomDataAPI_Point::GeomDataAPI_Point() {}
+GeomDataAPI_Point::GeomDataAPI_Point() = default;
-GeomDataAPI_Point::~GeomDataAPI_Point() {}
+GeomDataAPI_Point::~GeomDataAPI_Point() = default;
static std::string typeId() { return std::string("Point"); }
/// Returns the type of this class of attributes, not static method
- GEOMDATAAPI_EXPORT virtual std::string attributeType();
+ GEOMDATAAPI_EXPORT std::string attributeType() override;
protected:
/// Objects are created for features automatically
GEOMDATAAPI_EXPORT GeomDataAPI_Point();
- GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Point();
+ GEOMDATAAPI_EXPORT ~GeomDataAPI_Point() override;
};
//! Pointer on attribute object
-typedef std::shared_ptr<GeomDataAPI_Point> AttributePointPtr;
+using AttributePointPtr = std::shared_ptr<GeomDataAPI_Point>;
#endif
static std::string typeId() { return std::string("Point2D"); }
/// Returns the type of this class of attributes, not static method
- GEOMDATAAPI_EXPORT virtual std::string attributeType();
+ GEOMDATAAPI_EXPORT std::string attributeType() override;
/// Returns this attribute from the data if it is possible
/// \param theData a model data
protected:
/// Objects are created for features automatically
GEOMDATAAPI_EXPORT GeomDataAPI_Point2D();
- GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Point2D();
+ GEOMDATAAPI_EXPORT ~GeomDataAPI_Point2D() override;
};
//! Pointer on attribute object
-typedef std::shared_ptr<GeomDataAPI_Point2D> AttributePoint2DPtr;
+using AttributePoint2DPtr = std::shared_ptr<GeomDataAPI_Point2D>;
#endif
static std::string typeId() { return std::string("Point2DArray"); }
/// Returns the type of this class of attributes, not static method
- GEOMDATAAPI_EXPORT virtual std::string attributeType();
+ GEOMDATAAPI_EXPORT std::string attributeType() override;
protected:
/// Objects are created for features automatically
GEOMDATAAPI_EXPORT GeomDataAPI_Point2DArray();
- GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Point2DArray();
+ GEOMDATAAPI_EXPORT ~GeomDataAPI_Point2DArray() override;
};
-typedef std::shared_ptr<GeomDataAPI_Point2DArray> AttributePoint2DArrayPtr;
+using AttributePoint2DArrayPtr = std::shared_ptr<GeomDataAPI_Point2DArray>;
#endif
//! \param[in] theAttribute the checked attribute
//! \param[in] theArguments arguments of the attribute
//! \param[out] theError error message.
- GEOMVALIDATORS_EXPORT virtual bool
+ GEOMVALIDATORS_EXPORT bool
isValid(const AttributePtr &theAttribute,
const std::list<std::string> &theArguments,
- Events_InfoMessage &theError) const;
+ Events_InfoMessage &theError) const override;
};
#endif
#include <TopoDS_Edge.hxx>
#include <TopoDS_Iterator.hxx>
-//#define DEB_NAMING 1
+// #define DEB_NAMING 1
#ifdef DEB_NAMING
#include <BRepTools.hxx>
#endif
TDF_Label myLab; ///< if attribute is not initialized, store label here
public:
/// Defines the std::string value
- MODEL_EXPORT virtual void setValue(const std::string &theValue);
+ MODEL_EXPORT void setValue(const std::string &theValue) override;
/// Defines the std::wstring value
- MODEL_EXPORT virtual void setValue(const std::wstring &theValue);
+ MODEL_EXPORT void setValue(const std::wstring &theValue) override;
/// Returns the std::string value
- MODEL_EXPORT virtual std::string value();
+ MODEL_EXPORT std::string value() override;
/// Returns a pointer to Unicode string
- MODEL_EXPORT virtual char16_t *valueU();
+ MODEL_EXPORT char16_t *valueU() override;
/// Returns true if Unicode string was stored
- MODEL_EXPORT virtual bool isUValue() const;
+ MODEL_EXPORT bool isUValue() const override;
protected:
/// Initializes attributes
Model_AttributeString(TDF_Label &theLabel);
/// Reinitializes the internal state of the attribute (may be needed on
/// undo/redo, abort, etc)
- virtual void reinit();
+ void reinit() override;
friend class Model_Data;
};
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
// DEB
-//#include <TCollection_AsciiString.hxx>
-//#define DEB_IMPORT 1
+// #include <TCollection_AsciiString.hxx>
+// #define DEB_IMPORT 1
/// reference to the shape in external document: sting list attribute identifier
static const Standard_GUID
return myObjs->objectByName(theGroupID, theName);
}
-const int Model_Document::index(std::shared_ptr<ModelAPI_Object> theObject,
- const bool theAllowFolder) {
+int Model_Document::index(std::shared_ptr<ModelAPI_Object> theObject,
+ const bool theAllowFolder) {
return myObjs->index(theObject, theAllowFolder);
}
//! This kind is used for feature buttons enable/disable depending on active
//! document (it uses workbench "document" identifier in XML configuration
//! file for this)
- MODEL_EXPORT virtual const std::string &kind() const { return myKind; }
+ MODEL_EXPORT const std::string &kind() const override { return myKind; }
//! Loads the OCAF document from the file.
//! \param theDirName directory of the loaded file
//! features
//! (useful for import to PartSet), but do not import it
//! \returns true if file was loaded successfully
- MODEL_EXPORT virtual bool
+ MODEL_EXPORT bool
importPart(const char *theFileName,
std::list<std::shared_ptr<ModelAPI_Feature>> &theImported,
- bool theCheckOnly = false);
+ bool theCheckOnly = false) override;
//! Saves the OCAF document to the file.
//! \param theDirName directory where the document will be saved
//! Export the list of features to the file
//! \param theFilename path to save the file
//! \param theExportFeatures list of features to export
- MODEL_EXPORT virtual bool
- save(const char *theFilename,
- const std::list<std::shared_ptr<ModelAPI_Feature>> &theExportFeatures)
- const;
+ MODEL_EXPORT bool save(const char *theFilename,
+ const std::list<std::shared_ptr<ModelAPI_Feature>>
+ &theExportFeatures) const override;
//! Removes document data
//! \param theForever if it is false, document is just hidden
//! (to keep possibility make it back on Undo/Redo)
- MODEL_EXPORT virtual void close(const bool theForever = false);
+ MODEL_EXPORT void close(const bool theForever = false) override;
//! Starts a new operation (opens a transaction)
MODEL_EXPORT virtual void startOperation();
//! Adds to the document the new feature of the given feature id
//! \param theID creates feature and puts it in the document
//! \param theMakeCurrent to make current this new feature in this document
- MODEL_EXPORT virtual FeaturePtr addFeature(std::string theID,
- const bool theMakeCurrent = true);
+ MODEL_EXPORT FeaturePtr addFeature(std::string theID,
+ const bool theMakeCurrent = true) override;
//! Return a list of features, which refers to the feature
//! \param theFeature a feature
//! \param theRefs a list of reference features
//! \param isSendError a flag whether the error message should be send
- MODEL_EXPORT virtual void refsToFeature(FeaturePtr theFeature,
- std::set<FeaturePtr> &theRefs,
- const bool isSendError = true);
+ MODEL_EXPORT void refsToFeature(FeaturePtr theFeature,
+ std::set<FeaturePtr> &theRefs,
+ const bool isSendError = true) override;
//! Removes the feature from the document (with result)
//! It is necessary to flush REDISPLAY signal manually after this method
//! because the method sends it, but for the performance purpose does not
//! flush it \param theFeature a removed feature
- MODEL_EXPORT virtual void removeFeature(FeaturePtr theFeature);
+ MODEL_EXPORT void removeFeature(FeaturePtr theFeature) override;
//! Moves the feature to make it after the given one in the history.
- MODEL_EXPORT virtual void moveFeature(FeaturePtr theMoved,
- FeaturePtr theAfterThis,
- const bool theSplit = false);
+ MODEL_EXPORT void moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis,
+ const bool theSplit = false) override;
//! Returns the first found object in the group by the object name
//! \param theGroupID group that contains an object
//! \param theName name of the object to search
//! \returns null if such object is not found
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Object>
- objectByName(const std::string &theGroupID, const std::wstring &theName);
+ MODEL_EXPORT std::shared_ptr<ModelAPI_Object>
+ objectByName(const std::string &theGroupID,
+ const std::wstring &theName) override;
//! Returns the object index in the group. Object must be visible. Otherwise
//! returns -1. \param theObject object of this document \param theAllowFolder
//! take into account grouping feature by folders \returns index started from
//! zero, or -1 if object is invisible or belongs to another document
- MODEL_EXPORT virtual const int
- index(std::shared_ptr<ModelAPI_Object> theObject,
- const bool theAllowFolder = false);
+ MODEL_EXPORT int index(std::shared_ptr<ModelAPI_Object> theObject,
+ const bool theAllowFolder = false) override;
//! Internal sub-document by ID
MODEL_EXPORT virtual std::shared_ptr<Model_Document> subDoc(int theDocID);
///! Returns the id of the document
- MODEL_EXPORT virtual const int id() const { return myID; }
+ MODEL_EXPORT int id() const override { return myID; }
//! Returns the feature in the group by the index (started from zero)
//! \param theGroupID group that contains a feature
//! \param theIndex zero-based index of feature in the group
//! \param theAllowFolder take into account grouping feature by folders
- MODEL_EXPORT virtual ObjectPtr object(const std::string &theGroupID,
- const int theIndex,
- const bool theAllowFolder = false);
+ MODEL_EXPORT ObjectPtr object(const std::string &theGroupID,
+ const int theIndex,
+ const bool theAllowFolder = false) override;
//! Returns the number of features in the group
//! \param theGroupID group of objects
//! \param theAllowFolder take into account grouping feature by folders
- MODEL_EXPORT virtual int size(const std::string &theGroupID,
- const bool theAllowFolder = false);
+ MODEL_EXPORT int size(const std::string &theGroupID,
+ const bool theAllowFolder = false) override;
//! Returns the parent object of this child. This may be result or feature,
//! parent of a top result. Fast method, that uses internal data structure
//! specifics.
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Object>
- parent(const std::shared_ptr<ModelAPI_Object> theChild);
+ MODEL_EXPORT std::shared_ptr<ModelAPI_Object>
+ parent(const std::shared_ptr<ModelAPI_Object> theChild) override;
//! Returns the feature that is currently edited in this document, normally
//! this is the latest created feature
//! \param theVisible use visible features only: flag is true for Object
//! Browser functionality \returns null if next created feature must be the
//! first
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
- currentFeature(const bool theVisible);
+ MODEL_EXPORT std::shared_ptr<ModelAPI_Feature>
+ currentFeature(const bool theVisible) override;
//! Sets the current feature: all features below will be disabled, new
//! features will be appended after this one. \param theCurrent the selected
//! feature as current: below it everything becomes disabled \param theVisible
//! use visible features only: flag is true for Object Browser functionality
- MODEL_EXPORT virtual void
+ MODEL_EXPORT void
setCurrentFeature(std::shared_ptr<ModelAPI_Feature> theCurrent,
- const bool theVisible);
+ const bool theVisible) override;
//! Makes the current feature one feature upper
- MODEL_EXPORT virtual void setCurrentFeatureUp();
+ MODEL_EXPORT void setCurrentFeatureUp() override;
//! Returns the number of all features: in the history or not
- MODEL_EXPORT virtual int numInternalFeatures();
+ MODEL_EXPORT int numInternalFeatures() override;
//! Returns the feature by zero-based index: features in the history or not
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
- internalFeature(const int theIndex);
+ MODEL_EXPORT std::shared_ptr<ModelAPI_Feature>
+ internalFeature(const int theIndex) override;
//! Performs synchronization of transactions with the module document:
//! If some document is not active (by undo of activation) but in memory,
//! on activation the transactions must be synchronized because all redo-s
//! performed without this participation
- MODEL_EXPORT virtual void synchronizeTransactions();
+ MODEL_EXPORT void synchronizeTransactions() override;
/// Creates construction results
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultConstruction>
+ MODEL_EXPORT std::shared_ptr<ModelAPI_ResultConstruction>
createConstruction(const std::shared_ptr<ModelAPI_Data> &theFeatureData,
- const int theIndex = 0);
+ const int theIndex = 0) override;
/// Creates a body results
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultBody>
+ MODEL_EXPORT std::shared_ptr<ModelAPI_ResultBody>
createBody(const std::shared_ptr<ModelAPI_Data> &theFeatureData,
- const int theIndex = 0);
+ const int theIndex = 0) override;
/// Creates a part results
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultPart>
+ MODEL_EXPORT std::shared_ptr<ModelAPI_ResultPart>
createPart(const std::shared_ptr<ModelAPI_Data> &theFeatureData,
- const int theIndex = 0);
+ const int theIndex = 0) override;
//! Copies a part result, keeping the reference to origin
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultPart>
+ MODEL_EXPORT std::shared_ptr<ModelAPI_ResultPart>
copyPart(const std::shared_ptr<ModelAPI_ResultPart> &theOrigin,
const std::shared_ptr<ModelAPI_Data> &theFeatureData,
- const int theIndex = 0);
+ const int theIndex = 0) override;
/// Creates a group result
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultGroup>
+ MODEL_EXPORT std::shared_ptr<ModelAPI_ResultGroup>
createGroup(const std::shared_ptr<ModelAPI_Data> &theFeatureData,
- const int theIndex = 0);
+ const int theIndex = 0) override;
/// Creates a field result
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultField>
+ MODEL_EXPORT std::shared_ptr<ModelAPI_ResultField>
createField(const std::shared_ptr<ModelAPI_Data> &theFeatureData,
- const int theIndex = 0);
+ const int theIndex = 0) override;
/// Creates a parameter result
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultParameter>
+ MODEL_EXPORT std::shared_ptr<ModelAPI_ResultParameter>
createParameter(const std::shared_ptr<ModelAPI_Data> &theFeatureData,
- const int theIndex = 0);
+ const int theIndex = 0) override;
//! Returns a feature by result (owner of result)
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
- feature(const std::shared_ptr<ModelAPI_Result> &theResult);
+ MODEL_EXPORT std::shared_ptr<ModelAPI_Feature>
+ feature(const std::shared_ptr<ModelAPI_Result> &theResult) override;
//! Creates a folder (group of the features in the object browser)
//! \param theAddBefore a feature, the folder is added before
//! (if empty, the folder is added after the last feature)
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Folder>
+ MODEL_EXPORT std::shared_ptr<ModelAPI_Folder>
addFolder(std::shared_ptr<ModelAPI_Feature> theAddBefore =
- std::shared_ptr<ModelAPI_Feature>());
+ std::shared_ptr<ModelAPI_Feature>()) override;
//! Removes the folder from the document (all features in the folder will be
//! kept).
- MODEL_EXPORT virtual void
- removeFolder(std::shared_ptr<ModelAPI_Folder> theFolder);
+ MODEL_EXPORT void
+ removeFolder(std::shared_ptr<ModelAPI_Folder> theFolder) override;
//! Search a folder above the list of features applicable to store them
//! (it means the list of features stored in the folder should be
//! consequential) \return Empty pointer if there is no applicable folder
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Folder> findFolderAbove(
- const std::list<std::shared_ptr<ModelAPI_Feature>> &theFeatures);
+ MODEL_EXPORT std::shared_ptr<ModelAPI_Folder> findFolderAbove(
+ const std::list<std::shared_ptr<ModelAPI_Feature>> &theFeatures) override;
//! Search a folder below the list of features applicable to store them
//! (it means the list of features stored in the folder should be
//! consequential) \return Empty pointer if there is no applicable folder
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Folder> findFolderBelow(
- const std::list<std::shared_ptr<ModelAPI_Feature>> &theFeatures);
+ MODEL_EXPORT std::shared_ptr<ModelAPI_Folder> findFolderBelow(
+ const std::list<std::shared_ptr<ModelAPI_Feature>> &theFeatures) override;
//! Search a folder containing the given feature.
//! Additionally calculates a zero-based index of the feature in this folder.
//! \param theFeature feature to search
//! \param theIndexInFolder zero-based index in the folder or -1 if the
//! feature is top-level. \return the folder containing the feature or empty
//! pointer if the feature is top-level.
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Folder>
+ MODEL_EXPORT std::shared_ptr<ModelAPI_Folder>
findContainingFolder(const std::shared_ptr<ModelAPI_Feature> &theFeature,
- int &theIndexInFolder);
+ int &theIndexInFolder) override;
//! Add a list of features to the folder. The correctness of the adding is not
//! performed (such checks have been done in corresponding find.. method).
//! \return \c true if the movement is successful
- MODEL_EXPORT virtual bool
+ MODEL_EXPORT bool
moveToFolder(const std::list<std::shared_ptr<ModelAPI_Feature>> &theFeatures,
- const std::shared_ptr<ModelAPI_Folder> &theFolder);
+ const std::shared_ptr<ModelAPI_Folder> &theFolder) override;
//! Remove features from the folder
//! \param theFeatures list of features to be removed
//! \param theBefore extract features before the folder (this parameter is
//! when all features in the folder are taking out,
//! in other cases the direction is taken automatically)
//! \return \c true if the features have been moved out
- MODEL_EXPORT virtual bool removeFromFolder(
+ MODEL_EXPORT bool removeFromFolder(
const std::list<std::shared_ptr<ModelAPI_Feature>> &theFeatures,
- const bool theBefore = true);
+ const bool theBefore = true) override;
///! Returns true if parametric updater need to execute feature on
/// recomputation ! On abort, undo or redo it is not necessary: results in
///! Returns all features of the document including the hidden features which
/// are not in ! history. Not very fast method, for calling once, not in big
/// cycles.
- MODEL_EXPORT virtual std::list<std::shared_ptr<ModelAPI_Feature>>
- allFeatures();
+ MODEL_EXPORT std::list<std::shared_ptr<ModelAPI_Feature>>
+ allFeatures() override;
//! Returns all objects of the document including the hidden features which
//! are not in history. Not very fast method, for calling once, not in big
//! cycles.
- MODEL_EXPORT virtual std::list<std::shared_ptr<ModelAPI_Object>> allObjects();
+ MODEL_EXPORT std::list<std::shared_ptr<ModelAPI_Object>>
+ allObjects() override;
/// Returns the global identifier of the current transaction (needed for the
/// update algo)
MODEL_EXPORT virtual void incrementTransactionID();
/// Returns true if document is opened and valid
- MODEL_EXPORT virtual bool isOpened();
+ MODEL_EXPORT bool isOpened() override;
/// Returns the last feature in the document (even not visible or disabled)
/// \returns null if there is no features
FeaturePtr lastFeature();
/// Returns the feature that produced the given face of the given result.
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
+ MODEL_EXPORT std::shared_ptr<ModelAPI_Feature>
producedByFeature(std::shared_ptr<ModelAPI_Result> theResult,
- const std::shared_ptr<GeomAPI_Shape> &theShape);
+ const std::shared_ptr<GeomAPI_Shape> &theShape) override;
/// Returns true if theLater is in history of features creation later than
/// theCurrent
- MODEL_EXPORT virtual bool isLater(FeaturePtr theLater,
- FeaturePtr theCurrent) const;
+ MODEL_EXPORT bool isLater(FeaturePtr theLater,
+ FeaturePtr theCurrent) const override;
/// Just removes all features without touching the document data (to be able
/// undo)
- MODEL_EXPORT virtual void eraseAllFeatures();
+ MODEL_EXPORT void eraseAllFeatures() override;
/// Returns the next (from the history point of view) feature, any: invisible
/// or disabled \param theCurrent previous to the resulting feature \param
/// theReverse if it is true, iterates in reversed order (next becomes
/// previous)
- MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
+ MODEL_EXPORT std::shared_ptr<ModelAPI_Feature>
nextFeature(std::shared_ptr<ModelAPI_Feature> theCurrent,
- const bool theReverse = false) const;
+ const bool theReverse = false) const override;
//! Erases the document structure.
- ~Model_Document();
+ ~Model_Document() override;
protected:
//! Returns (creates if needed) the general label
//! Internally makes document know that feature was removed or added in
//! history after creation
- virtual void updateHistory(const std::shared_ptr<ModelAPI_Object> theObject);
+ void updateHistory(const std::shared_ptr<ModelAPI_Object> theObject) override;
//! Internally makes document know that feature was removed or added in
//! history after creation
- virtual void updateHistory(const std::string theGroup);
+ void updateHistory(const std::string theGroup) override;
//! Returns true if the document is root module document
bool isRoot() const;
///! Informs the document that it becomes active and some actions must be
/// performed
- virtual void setActive(const bool theFlag);
+ void setActive(const bool theFlag) override;
//! Returns true if this document is currently active
- virtual bool isActive() const;
+ bool isActive() const override;
//! Returns the selection attribute that is used
//! for calculation of selection externally from the document
/// Stores in the document boolean flags: states of the nodes in the object
/// browser. Normally is called outside of the transaction, just before
/// "save".
- virtual void storeNodesState(const std::list<bool> &theStates);
+ void storeNodesState(const std::list<bool> &theStates) override;
/// Returns the stored nodes states. Normally it is called just after "open".
/// Appends the values to theStates list.
- virtual void restoreNodesState(std::list<bool> &theStates) const;
+ void restoreNodesState(std::list<bool> &theStates) const override;
/// Label that contains structures for selection of constructions of another
/// document
//! Information related to the every user-transaction
struct Transaction {
- int myOCAFNum; ///< number of OCAF transactions related to each "this"
+ int myOCAFNum{0}; ///< number of OCAF transactions related to each "this"
///< transaction, may be 0
std::string myId; ///< user-identifier string of transaction
//! default constructor with default Id
- Transaction() : myOCAFNum(0), myId("") {}
+ Transaction() : myId("") {}
};
//! transaction indexes (related to myTransactionsAfterSave) and info about
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeString.h>
-Model_ResultParameter::~Model_ResultParameter() {}
+Model_ResultParameter::~Model_ResultParameter() = default;
void Model_ResultParameter::initAttributes() {
data()->addAttribute(ModelAPI_ResultParameter::VALUE(),
ModelAPI_AttributeDouble::typeId());
}
-Model_ResultParameter::Model_ResultParameter() {}
+Model_ResultParameter::Model_ResultParameter() = default;
*/
class Model_ResultParameter : public ModelAPI_ResultParameter {
public:
- MODEL_EXPORT virtual ~Model_ResultParameter();
- MODEL_EXPORT virtual void initAttributes();
+ MODEL_EXPORT ~Model_ResultParameter() override;
+ MODEL_EXPORT void initAttributes() override;
protected:
Model_ResultParameter();
Model_Update MY_UPDATER_INSTANCE; /// the only one instance initialized on load
/// of the library
-//#define DEB_UPDATE
+// #define DEB_UPDATE
#ifdef DEB_UPDATE
#include <Locale_Convert.h>
};
//! Pointer on attribute object
-typedef std::shared_ptr<ModelAPI_Attribute> AttributePtr;
+using AttributePtr = std::shared_ptr<ModelAPI_Attribute>;
#endif
MODELAPI_EXPORT static std::string typeId() { return "Boolean"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeBoolean();
+ MODELAPI_EXPORT ~ModelAPI_AttributeBoolean() override;
protected:
/// Objects are created for features automatically
MODELAPI_EXPORT ModelAPI_AttributeBoolean();
};
-typedef std::shared_ptr<ModelAPI_AttributeBoolean> AttributeBooleanPtr;
+using AttributeBooleanPtr = std::shared_ptr<ModelAPI_AttributeBoolean>;
#endif
MODELAPI_EXPORT static std::string typeId() { return "DocRef"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeDocRef();
+ MODELAPI_EXPORT ~ModelAPI_AttributeDocRef() override;
protected:
/// Objects are created for features automatically
MODELAPI_EXPORT ModelAPI_AttributeDocRef();
};
-typedef std::shared_ptr<ModelAPI_AttributeDocRef> AttributeDocRefPtr;
+using AttributeDocRefPtr = std::shared_ptr<ModelAPI_AttributeDocRef>;
#endif
MODELAPI_EXPORT static std::string typeId() { return "Double"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeDouble();
+ MODELAPI_EXPORT ~ModelAPI_AttributeDouble() override;
protected:
/// Objects are created for features automatically
};
//! Pointer on double attribute
-typedef std::shared_ptr<ModelAPI_AttributeDouble> AttributeDoublePtr;
+using AttributeDoublePtr = std::shared_ptr<ModelAPI_AttributeDouble>;
#endif
MODELAPI_EXPORT static std::string typeId() { return "DoubleArray"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeDoubleArray();
+ MODELAPI_EXPORT ~ModelAPI_AttributeDoubleArray() override;
protected:
/// Objects are created for features automatically
};
/// Pointer on double attribute
-typedef std::shared_ptr<ModelAPI_AttributeDoubleArray> AttributeDoubleArrayPtr;
+using AttributeDoubleArrayPtr = std::shared_ptr<ModelAPI_AttributeDoubleArray>;
#endif
std::string ModelAPI_AttributeImage::attributeType() { return typeId(); }
/// To virtually destroy the fields of successors
-ModelAPI_AttributeImage::~ModelAPI_AttributeImage() {}
+ModelAPI_AttributeImage::~ModelAPI_AttributeImage() = default;
-ModelAPI_AttributeImage::ModelAPI_AttributeImage() {}
+ModelAPI_AttributeImage::ModelAPI_AttributeImage() = default;
MODELAPI_EXPORT static std::string typeId() { return "Image"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeImage();
+ MODELAPI_EXPORT ~ModelAPI_AttributeImage() override;
protected:
/// Objects are created for features automatically
};
//! Pointer on image attribute
-typedef std::shared_ptr<ModelAPI_AttributeImage> AttributeImagePtr;
+using AttributeImagePtr = std::shared_ptr<ModelAPI_AttributeImage>;
#endif
MODELAPI_EXPORT static std::string typeId() { return "IntArray"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeIntArray();
+ MODELAPI_EXPORT ~ModelAPI_AttributeIntArray() override;
protected:
/// Objects are created for features automatically
};
//! Pointer on double attribute
-typedef std::shared_ptr<ModelAPI_AttributeIntArray> AttributeIntArrayPtr;
+using AttributeIntArrayPtr = std::shared_ptr<ModelAPI_AttributeIntArray>;
#endif
MODELAPI_EXPORT static std::string typeId() { return "Integer"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeInteger();
+ MODELAPI_EXPORT ~ModelAPI_AttributeInteger() override;
protected:
/// Objects are created for features automatically
};
//! Pointer on double attribute
-typedef std::shared_ptr<ModelAPI_AttributeInteger> AttributeIntegerPtr;
+using AttributeIntegerPtr = std::shared_ptr<ModelAPI_AttributeInteger>;
#endif
MODELAPI_EXPORT static std::string typeId() { return "RefAttr"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeRefAttr();
+ MODELAPI_EXPORT ~ModelAPI_AttributeRefAttr() override;
protected:
/// Objects are created for features automatically
MODELAPI_EXPORT ModelAPI_AttributeRefAttr();
};
-typedef std::shared_ptr<ModelAPI_AttributeRefAttr> AttributeRefAttrPtr;
+using AttributeRefAttrPtr = std::shared_ptr<ModelAPI_AttributeRefAttr>;
#endif
std::string ModelAPI_AttributeRefAttrList::attributeType() { return typeId(); }
-ModelAPI_AttributeRefAttrList::~ModelAPI_AttributeRefAttrList() {}
+ModelAPI_AttributeRefAttrList::~ModelAPI_AttributeRefAttrList() = default;
-ModelAPI_AttributeRefAttrList::ModelAPI_AttributeRefAttrList() {}
+ModelAPI_AttributeRefAttrList::ModelAPI_AttributeRefAttrList() = default;
MODELAPI_EXPORT static std::string typeId() { return "RefAttrList"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// Appends the feature to the end of a list
virtual void append(ObjectPtr theObject) = 0;
/// \param theIndices a list of indices of elements to be removed
virtual void remove(const std::set<int> &theIndices) = 0;
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeRefAttrList();
+ MODELAPI_EXPORT ~ModelAPI_AttributeRefAttrList() override;
protected:
/// Objects are created for features automatically
MODELAPI_EXPORT ModelAPI_AttributeRefAttrList();
};
-typedef std::shared_ptr<ModelAPI_AttributeRefAttrList> AttributeRefAttrListPtr;
+using AttributeRefAttrListPtr = std::shared_ptr<ModelAPI_AttributeRefAttrList>;
#endif
MODELAPI_EXPORT static std::string typeId() { return "RefList"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// Appends the feature to the end of a list
virtual void append(ObjectPtr theObject) = 0;
/// \param theIndices a list of indices of elements to be removed
virtual void remove(const std::set<int> &theIndices) = 0;
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeRefList();
+ MODELAPI_EXPORT ~ModelAPI_AttributeRefList() override;
protected:
/// Objects are created for features automatically
MODELAPI_EXPORT ModelAPI_AttributeRefList();
};
-typedef std::shared_ptr<ModelAPI_AttributeRefList> AttributeRefListPtr;
+using AttributeRefListPtr = std::shared_ptr<ModelAPI_AttributeRefList>;
#endif
MODELAPI_EXPORT static std::string typeId() { return "Reference"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeReference();
+ MODELAPI_EXPORT ~ModelAPI_AttributeReference() override;
protected:
/// Objects are created for features automatically
MODELAPI_EXPORT ModelAPI_AttributeReference();
};
-typedef std::shared_ptr<ModelAPI_AttributeReference> AttributeReferencePtr;
+using AttributeReferencePtr = std::shared_ptr<ModelAPI_AttributeReference>;
#endif
static std::string typeId() { return "Selection"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// Returns a textual string of the selection
/// \param theDefaultValue a value, which is used if the naming name can not
virtual bool isGeometricalSelection() const = 0;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeSelection();
+ MODELAPI_EXPORT ~ModelAPI_AttributeSelection() override;
/// Returns the name by context. Adds the part name if the context is located
/// in other document
};
//! Pointer on double attribute
-typedef std::shared_ptr<ModelAPI_AttributeSelection> AttributeSelectionPtr;
+using AttributeSelectionPtr = std::shared_ptr<ModelAPI_AttributeSelection>;
#endif
static std::string typeId() { return "SelectionList"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeSelectionList();
+ MODELAPI_EXPORT ~ModelAPI_AttributeSelectionList() override;
/// Returns a selection filters feature if it is defined for this selection
/// list
/// Returns true if the whole result selection corresponds to selection of all
/// sub-shapes.
- MODELAPI_EXPORT virtual const bool isWholeResultAllowed() const {
+ MODELAPI_EXPORT virtual bool isWholeResultAllowed() const {
return myIsWholeResultAllowed;
}
}
/// Returns true if a copy features must be used in update in history.
- MODELAPI_EXPORT virtual const bool isMakeCopy() const { return myMakeCopy; }
+ MODELAPI_EXPORT virtual bool isMakeCopy() const { return myMakeCopy; }
/// Sets true if a copy features must be used in update in history.
MODELAPI_EXPORT virtual void setMakeCopy(const bool theFlag) {
};
//! Pointer on double attribute
-typedef std::shared_ptr<ModelAPI_AttributeSelectionList>
- AttributeSelectionListPtr;
+using AttributeSelectionListPtr =
+ std::shared_ptr<ModelAPI_AttributeSelectionList>;
#endif
MODELAPI_EXPORT static std::string typeId() { return "String"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeString();
+ MODELAPI_EXPORT ~ModelAPI_AttributeString() override;
protected:
/// Objects are created for features automatically
};
//! Pointer on string attribute
-typedef std::shared_ptr<ModelAPI_AttributeString> AttributeStringPtr;
+using AttributeStringPtr = std::shared_ptr<ModelAPI_AttributeString>;
#endif
/// Returns the type of this class of attributes
MODELAPI_EXPORT static std::string typeId() { return "Tables"; }
/// Returns the type of this class of attributes, not static method
- MODELAPI_EXPORT virtual std::string attributeType();
+ MODELAPI_EXPORT std::string attributeType() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeTables();
+ MODELAPI_EXPORT ~ModelAPI_AttributeTables() override;
protected:
/// Objects are created for features automatically
};
/// Pointer on double attribute
-typedef std::shared_ptr<ModelAPI_AttributeTables> AttributeTablesPtr;
+using AttributeTablesPtr = std::shared_ptr<ModelAPI_AttributeTables>;
#endif
const std::list<std::string> &theArguments,
Events_InfoMessage &theError) const = 0;
- MODELAPI_EXPORT ~ModelAPI_AttributeValidator();
+ MODELAPI_EXPORT ~ModelAPI_AttributeValidator() override;
};
#endif
*/
class ModelAPI_CompositeFeature : public ModelAPI_Feature {
public:
- MODELAPI_EXPORT virtual ~ModelAPI_CompositeFeature();
+ MODELAPI_EXPORT ~ModelAPI_CompositeFeature() override;
/// Adds feature to the sketch and to its document
virtual std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID) = 0;
virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature) = 0;
/// in addition removes all subs
- MODELAPI_EXPORT virtual void erase();
+ MODELAPI_EXPORT void erase() override;
};
//! Pointer on the composite feature object
-typedef std::shared_ptr<ModelAPI_CompositeFeature> CompositeFeaturePtr;
+using CompositeFeaturePtr = std::shared_ptr<ModelAPI_CompositeFeature>;
#endif
friend class ModelAPI_Object;
};
-typedef std::shared_ptr<ModelAPI_Data> DataPtr;
+using DataPtr = std::shared_ptr<ModelAPI_Data>;
#endif
#include <ModelAPI_Document.h>
-ModelAPI_Document::~ModelAPI_Document() {}
+ModelAPI_Document::~ModelAPI_Document() = default;
/// Only for SWIG wrapping it is here
-ModelAPI_Document::ModelAPI_Document() {}
+ModelAPI_Document::ModelAPI_Document() = default;
const bool theSplit = false) = 0;
///! Returns the id of the document
- virtual const int id() const = 0;
+ virtual int id() const = 0;
//! Returns the object in the group by the index (started from zero)
//! \param theGroupID group that contains an object
//! returns -1. \param theObject object of this document \param theAllowFolder
//! take into account grouping feature by folders \returns index started from
//! zero, or -1 if object is invisible or belongs to another document
- virtual const int index(std::shared_ptr<ModelAPI_Object> theObject,
- const bool theAllowFolder = false) = 0;
+ virtual int index(std::shared_ptr<ModelAPI_Object> theObject,
+ const bool theAllowFolder = false) = 0;
//! Returns the number of objects in the group of objects
//! \param theGroupID group of objects
};
//! Pointer on document object
-typedef std::shared_ptr<ModelAPI_Document> DocumentPtr;
+using DocumentPtr = std::shared_ptr<ModelAPI_Document>;
#endif
virtual void emptyFunction() const {}
};
-typedef std::shared_ptr<ModelAPI_Entity> EntityPtr;
+using EntityPtr = std::shared_ptr<ModelAPI_Entity>;
#endif
MODELAPI_EXPORT ModelAPI_EventReentrantMessage(const Events_ID theID,
const void *theSender);
/// The virtual destructor
- MODELAPI_EXPORT virtual ~ModelAPI_EventReentrantMessage() {}
+ MODELAPI_EXPORT ~ModelAPI_EventReentrantMessage() override = default;
/// Static. Returns EventID of the message.
MODELAPI_EXPORT static Events_ID eventId() {
static const char *MY_EVENT_REENTRANT_MESSAGE_ID("EventReentrantMessage");
std::shared_ptr<GeomAPI_Pnt2d> myClickedPoint; ///< clicked point
};
-typedef std::shared_ptr<ModelAPI_EventReentrantMessage> ReentrantMessagePtr;
+using ReentrantMessagePtr = std::shared_ptr<ModelAPI_EventReentrantMessage>;
#endif
#include <GeomAPI_Pnt2d.h>
#include <GeomAPI_Shape.h>
-//#define DEBUG_OBJECT_MOVED_MESSAGE
+// #define DEBUG_OBJECT_MOVED_MESSAGE
#ifdef DEBUG_OBJECT_MOVED_MESSAGE
#include <iostream>
#endif
protected:
/// Creates an empty message
ModelAPI_ObjectUpdatedMessage(const Events_ID theID,
- const void *theSender = 0);
+ const void *theSender = nullptr);
/// The virtual destructor
- virtual ~ModelAPI_ObjectUpdatedMessage();
+ ~ModelAPI_ObjectUpdatedMessage() override;
public:
/// Returns the feature that has been updated
virtual const std::set<ObjectPtr> &objects() const = 0;
//! Creates a new empty group (to store it in the loop before flush)
- virtual std::shared_ptr<Events_MessageGroup> newEmpty() = 0;
+ std::shared_ptr<Events_MessageGroup> newEmpty() override = 0;
//! Allows to join the given message with the current one
- virtual void Join(const std::shared_ptr<Events_MessageGroup> &theJoined) = 0;
+ void Join(const std::shared_ptr<Events_MessageGroup> &theJoined) override = 0;
};
/// Message that feature was deleted (used for Object Browser update)
protected:
/// Creates an empty message
ModelAPI_ObjectDeletedMessage(const Events_ID theID,
- const void *theSender = 0);
+ const void *theSender = nullptr);
/// The virtual destructor
- virtual ~ModelAPI_ObjectDeletedMessage();
+ ~ModelAPI_ObjectDeletedMessage() override;
public:
/// Returns the groups where the objects were deleted
groups() const = 0;
/// Creates the new empty message of this kind
- virtual std::shared_ptr<Events_MessageGroup> newEmpty() = 0;
+ std::shared_ptr<Events_MessageGroup> newEmpty() override = 0;
/// Returns the identifier of the kind of a message
virtual const Events_ID messageId() = 0;
/// Appends to this message the given one.
- virtual void Join(const std::shared_ptr<Events_MessageGroup> &theJoined) = 0;
+ void Join(const std::shared_ptr<Events_MessageGroup> &theJoined) override = 0;
};
/// Message that order changed (used for Object Browser update)
protected:
/// Creates a message:
ModelAPI_OrderUpdatedMessage(const Events_ID theID,
- const void *theSender = 0);
+ const void *theSender = nullptr);
/// The virtual destructor
- virtual ~ModelAPI_OrderUpdatedMessage();
+ ~ModelAPI_OrderUpdatedMessage() override;
public:
/// Returns the document that has been updated
/// Allows to create ModelAPI messages
class MODELAPI_EXPORT ModelAPI_EventCreator {
public:
- virtual ~ModelAPI_EventCreator() {}
+ virtual ~ModelAPI_EventCreator() = default;
/// creates created, updated or moved messages and sends to the loop
virtual void sendUpdated(const ObjectPtr &theObject,
public:
/// Creates an empty message
MODELAPI_EXPORT ModelAPI_FeatureStateMessage(const Events_ID theID,
- const void *theSender = 0);
+ const void *theSender = nullptr);
/// The virtual destructor
- MODELAPI_EXPORT virtual ~ModelAPI_FeatureStateMessage();
+ MODELAPI_EXPORT ~ModelAPI_FeatureStateMessage() override;
/// Returns the feature this message is related to
MODELAPI_EXPORT std::shared_ptr<ModelAPI_Feature> feature() const;
public:
/// Creates an empty message
- MODELAPI_EXPORT ModelAPI_DocumentCreatedMessage(const Events_ID theID,
- const void *theSender = 0);
+ MODELAPI_EXPORT
+ ModelAPI_DocumentCreatedMessage(const Events_ID theID,
+ const void *theSender = nullptr);
/// The virtual destructor
- MODELAPI_EXPORT virtual ~ModelAPI_DocumentCreatedMessage();
+ MODELAPI_EXPORT ~ModelAPI_DocumentCreatedMessage() override;
/// Static. Returns EventID of the message.
MODELAPI_EXPORT static Events_ID eventId() {
static const char *MY_DOCUMENT_CREATED_EVENT_ID("DocumentCreated");
}
/// Creates an empty message
- MODELAPI_EXPORT ModelAPI_AttributeEvalMessage(const Events_ID theID,
- const void *theSender = 0);
+ MODELAPI_EXPORT
+ ModelAPI_AttributeEvalMessage(const Events_ID theID,
+ const void *theSender = nullptr);
/// The virtual destructor
- MODELAPI_EXPORT virtual ~ModelAPI_AttributeEvalMessage();
+ MODELAPI_EXPORT ~ModelAPI_AttributeEvalMessage() override;
/// Returns a document stored in the message
MODELAPI_EXPORT AttributePtr attribute() const;
}
/// Creates an empty message
- MODELAPI_EXPORT ModelAPI_ParameterEvalMessage(const Events_ID theID,
- const void *theSender = 0);
+ MODELAPI_EXPORT
+ ModelAPI_ParameterEvalMessage(const Events_ID theID,
+ const void *theSender = nullptr);
/// The virtual destructor
- MODELAPI_EXPORT virtual ~ModelAPI_ParameterEvalMessage();
+ MODELAPI_EXPORT ~ModelAPI_ParameterEvalMessage() override;
/// Returns a parameter stored in the message
MODELAPI_EXPORT FeaturePtr parameter() const;
}
/// Creates an empty message
- MODELAPI_EXPORT ModelAPI_ImportParametersMessage(const Events_ID theID,
- const void *theSender = 0);
+ MODELAPI_EXPORT
+ ModelAPI_ImportParametersMessage(const Events_ID theID,
+ const void *theSender = nullptr);
/// The virtual destructor
- MODELAPI_EXPORT virtual ~ModelAPI_ImportParametersMessage();
+ MODELAPI_EXPORT ~ModelAPI_ImportParametersMessage() override;
/// Returns a filename stored in the message
MODELAPI_EXPORT std::string filename() const;
/// Creates an empty message
MODELAPI_EXPORT ModelAPI_BuildEvalMessage(const Events_ID theID,
- const void *theSender = 0);
+ const void *theSender = nullptr);
/// The virtual destructor
- MODELAPI_EXPORT virtual ~ModelAPI_BuildEvalMessage();
+ MODELAPI_EXPORT ~ModelAPI_BuildEvalMessage() override;
/// Returns a parameter stored in the message
MODELAPI_EXPORT FeaturePtr parameter() const;
}
/// Creates an empty message
- MODELAPI_EXPORT ModelAPI_ComputePositionsMessage(const Events_ID theID,
- const void *theSender = 0);
+ MODELAPI_EXPORT
+ ModelAPI_ComputePositionsMessage(const Events_ID theID,
+ const void *theSender = nullptr);
/// The virtual destructor
- MODELAPI_EXPORT virtual ~ModelAPI_ComputePositionsMessage();
+ MODELAPI_EXPORT ~ModelAPI_ComputePositionsMessage() override;
/// Returns an expression stored in the message
MODELAPI_EXPORT const std::wstring &expression() const;
const void *theSender);
/// Creates an empty message
- MODELAPI_EXPORT ModelAPI_ObjectRenamedMessage(const Events_ID theID,
- const void *theSender = 0);
+ MODELAPI_EXPORT
+ ModelAPI_ObjectRenamedMessage(const Events_ID theID,
+ const void *theSender = nullptr);
/// The virtual destructor
- MODELAPI_EXPORT virtual ~ModelAPI_ObjectRenamedMessage();
+ MODELAPI_EXPORT ~ModelAPI_ObjectRenamedMessage() override;
/// Returns an object
MODELAPI_EXPORT ObjectPtr object() const;
/// Creates an empty message
MODELAPI_EXPORT
ModelAPI_ReplaceParameterMessage(const Events_ID theID,
- const void *theSender = 0);
+ const void *theSender = nullptr);
/// The virtual destructor
- MODELAPI_EXPORT virtual ~ModelAPI_ReplaceParameterMessage();
+ MODELAPI_EXPORT ~ModelAPI_ReplaceParameterMessage() override;
/// Returns an object
MODELAPI_EXPORT ObjectPtr object() const;
public:
/// Creates an message
MODELAPI_EXPORT ModelAPI_SolverFailedMessage(const Events_ID theID,
- const void *theSender = 0);
+ const void *theSender = nullptr);
/// Default destructor
- MODELAPI_EXPORT virtual ~ModelAPI_SolverFailedMessage();
+ MODELAPI_EXPORT ~ModelAPI_SolverFailedMessage() override;
/// Sets list of conflicting constraints
MODELAPI_EXPORT void setObjects(const std::set<ObjectPtr> &theObjects);
std::shared_ptr<GeomAPI_Pnt2d> myCurrentPosition;
public:
- MODELAPI_EXPORT ModelAPI_ObjectMovedMessage(const void *theSender = 0);
+ MODELAPI_EXPORT ModelAPI_ObjectMovedMessage(const void *theSender = nullptr);
/// Set object which is being moved (if the message already contains attribute
/// it will be cleared)
public:
/// Creates an message
MODELAPI_EXPORT ModelAPI_ShapesFailedMessage(const Events_ID theID,
- const void *theSender = 0);
+ const void *theSender = nullptr);
/// Default destructor
- MODELAPI_EXPORT virtual ~ModelAPI_ShapesFailedMessage();
+ MODELAPI_EXPORT ~ModelAPI_ShapesFailedMessage() override;
/// Static. Returns EventID of the message.
MODELAPI_EXPORT static Events_ID eventId() {
return Events_Loop::eventByName(EVENT_OPERATION_SHAPES_FAILED);
class ModelAPI_CheckConstraintsMessage : public Events_Message {
public:
/// Creates an empty message
- MODELAPI_EXPORT ModelAPI_CheckConstraintsMessage(const Events_ID theID,
- const void *theSender = 0);
+ MODELAPI_EXPORT
+ ModelAPI_CheckConstraintsMessage(const Events_ID theID,
+ const void *theSender = nullptr);
/// The virtual destructor
- MODELAPI_EXPORT virtual ~ModelAPI_CheckConstraintsMessage();
+ MODELAPI_EXPORT ~ModelAPI_CheckConstraintsMessage() override;
/// Get list of constrains
MODELAPI_EXPORT const std::set<ObjectPtr> &constraints() const;
/// Creates an message
MODELAPI_EXPORT
ModelAPI_FeaturesLicenseValidMessage(const Events_ID theID,
- const void *theSender = 0);
+ const void *theSender = nullptr);
/// Default destructor
- MODELAPI_EXPORT virtual ~ModelAPI_FeaturesLicenseValidMessage();
+ MODELAPI_EXPORT ~ModelAPI_FeaturesLicenseValidMessage() override;
/// Static. Returns EventID of the message.
MODELAPI_EXPORT static Events_ID eventId() {
return Events_Loop::eventByName(EVENT_FEATURE_LICENSE_VALID);
}
/// Returns document this feature belongs to
- virtual std::shared_ptr<ModelAPI_Document> document() const {
+ std::shared_ptr<ModelAPI_Document> document() const override {
return ModelAPI_Object::document();
}
/// Returns the group identifier of this result
- virtual std::string groupName() { return group(); }
+ std::string groupName() override { return group(); }
/// Computes or recomputes the results
virtual void execute() = 0;
/// removes all results from the feature
MODELAPI_EXPORT void eraseResults(const bool theForever = true);
/// removes all fields from this feature: results, data, etc
- MODELAPI_EXPORT virtual void erase();
+ MODELAPI_EXPORT void erase() override;
/// removes the result from the list of feature (not doing in disabled):
/// normally this method is not used from features. only internally
MODELAPI_EXPORT void
MODELAPI_EXPORT virtual bool setDisabled(const bool theFlag);
/// Returns the feature is disabled or not.
- MODELAPI_EXPORT virtual bool isDisabled();
+ MODELAPI_EXPORT bool isDisabled() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_Feature();
+ MODELAPI_EXPORT ~ModelAPI_Feature() override;
/// Returns the feature by the object (result).
MODELAPI_EXPORT static std::shared_ptr<ModelAPI_Feature>
protected:
/// This method is called just after creation of the object: it must
/// initialize all fields, normally initialized in the constructor
- MODELAPI_EXPORT virtual void init();
+ MODELAPI_EXPORT void init() override;
friend class Model_Document;
friend class Model_Objects;
};
//! Pointer on feature object
-typedef std::shared_ptr<ModelAPI_Feature> FeaturePtr;
+using FeaturePtr = std::shared_ptr<ModelAPI_Feature>;
//! An interface for performing special copy actions. To give feature which is
//! moved (a group) over this feature.
class ModelAPI_FeatureCopyInterface {
public:
- virtual ~ModelAPI_FeatureCopyInterface() {}
+ virtual ~ModelAPI_FeatureCopyInterface() = default;
/// An algorithm to update the moved feature by the separate Copy feature
/// \param theContext the original context object
*/
class ModelAPI_Filter {
public:
- virtual ~ModelAPI_Filter() {}
+ virtual ~ModelAPI_Filter() = default;
/// Returns name of the filter to represent it in GUI
virtual const std::string &name() const = 0;
bool myIsReverse;
};
-typedef std::shared_ptr<ModelAPI_Filter> FilterPtr;
+using FilterPtr = std::shared_ptr<ModelAPI_Filter>;
#endif
FiltersFeaturePtr
myFeature; ///< the feature is stored to minimize initAttribute interface
public:
- ModelAPI_FiltersArgs() {}
+ ModelAPI_FiltersArgs() = default;
/// Sets the current filter ID
void setFilter(const std::string &theFilterID) {
virtual const AttributePtr &baseAttribute() const = 0;
};
-typedef std::shared_ptr<ModelAPI_FiltersFeature> FiltersFeaturePtr;
+using FiltersFeaturePtr = std::shared_ptr<ModelAPI_FiltersFeature>;
#endif
public:
MODELAPI_EXPORT ModelAPI_Folder();
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_Folder();
+ MODELAPI_EXPORT ~ModelAPI_Folder() override;
/// Folder feature ID
static const std::string &ID() {
}
/// Returns the group identifier of this result
- virtual std::string groupName() { return group(); }
+ std::string groupName() override { return group(); }
/// Attribute referring first feature in the folder
static const std::string &FIRST_FEATURE_ID() {
/// Request for initialization of data model of the object: adding all
/// attributes
- MODELAPI_EXPORT virtual void initAttributes();
+ MODELAPI_EXPORT void initAttributes() override;
/// Computes or recomputes the results
MODELAPI_EXPORT virtual void execute();
/// Returns the feature is disabled or not.
- virtual bool isDisabled() { return false; }
+ bool isDisabled() override { return false; }
//
// Helper methods, aliases for data()->method()
protected:
/// This method is called just after creation of the object: it must
/// initialize all fields, normally initialized in the constructor
- MODELAPI_EXPORT virtual void init();
+ MODELAPI_EXPORT void init() override;
};
//! Pointer on a folder object
-typedef std::shared_ptr<ModelAPI_Folder> FolderPtr;
+using FolderPtr = std::shared_ptr<ModelAPI_Folder>;
#endif
processEvent(const std::shared_ptr<Events_Message> &theMessage) = 0;
};
-typedef std::shared_ptr<ModelAPI_IReentrant> ModelReentrantPtr;
+using ModelReentrantPtr = std::shared_ptr<ModelAPI_IReentrant>;
#endif
// sometimes it is useful for debug to see name of each object (bad for memory
// and performance)
-//#define DEBUG_NAMES
+// #define DEBUG_NAMES
/**\class ModelAPI_Object
* \ingroup DataModel
friend class Model_Document;
};
-typedef std::shared_ptr<ModelAPI_Object> ObjectPtr;
+using ObjectPtr = std::shared_ptr<ModelAPI_Object>;
#endif
setDisabled(std::shared_ptr<ModelAPI_Result> theThis, const bool theFlag);
/// Returns the result is disabled or not.
- MODELAPI_EXPORT virtual bool isDisabled();
+ MODELAPI_EXPORT bool isDisabled() override;
/// Request for initialization of data model of the result: adding all
/// attributes
- MODELAPI_EXPORT virtual void initAttributes();
+ MODELAPI_EXPORT void initAttributes() override;
/// To virtually destroy the fields of successors
- MODELAPI_EXPORT virtual ~ModelAPI_Result();
+ MODELAPI_EXPORT ~ModelAPI_Result() override;
/// Returns the shape-result produced by this feature (or null if no shapes)
MODELAPI_EXPORT virtual std::shared_ptr<GeomAPI_Shape> shape();
/// On change of attribute of the result update presentation of this result:
/// for the current moment there are only presentation attributes assigned to
/// results
- MODELAPI_EXPORT virtual void attributeChanged(const std::string &theID);
+ MODELAPI_EXPORT void attributeChanged(const std::string &theID) override;
protected:
/// This method is called just after creation of the object: it must
/// initialize all fields, normally initialized in the constructor
- MODELAPI_EXPORT virtual void init();
+ MODELAPI_EXPORT void init() override;
friend class Model_Objects;
};
//! Pointer on feature object
-typedef std::shared_ptr<ModelAPI_Result> ResultPtr;
+using ResultPtr = std::shared_ptr<ModelAPI_Result>;
#endif
*myBuilder; ///< provides the body processing in naming shape
public:
- MODELAPI_EXPORT virtual ~ModelAPI_ResultBody();
+ MODELAPI_EXPORT ~ModelAPI_ResultBody() override;
/// Reference to the image attribute of the result body.
inline static const std::string &IMAGE_ID() {
}
/// Returns the group identifier of this result
- MODELAPI_EXPORT virtual std::string groupName();
+ MODELAPI_EXPORT std::string groupName() override;
/// Returns the group identifier of this result
inline static std::string group() {
const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
/// Returns the shape-result produced by this feature
- MODELAPI_EXPORT virtual GeomShapePtr shape();
+ MODELAPI_EXPORT GeomShapePtr shape() override;
/// Records the subshape newShape which was generated during a topological
/// construction. As an example, consider the case of a face generated in
/// Set displayed flag to the result and all sub results
/// \param theDisplay a boolean value
- MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay);
+ MODELAPI_EXPORT void setDisplayed(const bool theDisplay) override;
/// Updates the sub-bodies if shape of this object is compsolid or compound
MODELAPI_EXPORT virtual void
};
//! Pointer on feature object
-typedef std::shared_ptr<ModelAPI_ResultBody> ResultBodyPtr;
+using ResultBodyPtr = std::shared_ptr<ModelAPI_ResultBody>;
#endif
class ModelAPI_ResultConstruction : public ModelAPI_Result {
public:
/// Returns the group identifier of this result
- MODELAPI_EXPORT virtual std::string groupName();
+ MODELAPI_EXPORT std::string groupName() override;
/// Returns the group identifier of this result
inline static std::string group() {
};
//! Pointer on feature object
-typedef std::shared_ptr<ModelAPI_ResultConstruction> ResultConstructionPtr;
+using ResultConstructionPtr = std::shared_ptr<ModelAPI_ResultConstruction>;
#endif
}
/// Returns the group identifier of this object
- virtual std::string groupName() { return group(); }
+ std::string groupName() override { return group(); }
/// Request for initialization of data model of the object: adding all
/// attributes
- virtual void initAttributes() {}
+ void initAttributes() override {}
/// Returns the feature is disabled or not.
- virtual bool isDisabled() { return false; }
+ bool isDisabled() override { return false; }
/// Returns true if object must be displayed in the viewer: flag is stored
/// in the data model, so on undo/redo, open/save or recreation of object by
/// history-playing it keeps the original state in the current transaction.
- virtual bool isDisplayed() { return myIsDisplayed; }
+ bool isDisplayed() override { return myIsDisplayed; }
/// Sets the displayed/hidden state of the object. If it is changed, sends
/// the "redisplay" signal.
- MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay);
+ MODELAPI_EXPORT void setDisplayed(const bool theDisplay) override;
/// Returns a GUI name of this step
MODELAPI_EXPORT virtual std::wstring name() = 0;
protected:
/// This method is called just after creation of the object: it must
/// initialize all fields, normally initialized in the constructor
- MODELAPI_EXPORT virtual void init() {}
+ MODELAPI_EXPORT void init() override {}
private:
bool myIsDisplayed;
};
- MODELAPI_EXPORT virtual ~ModelAPI_ResultField();
+ MODELAPI_EXPORT ~ModelAPI_ResultField() override;
/// Returns the group identifier of this result
- MODELAPI_EXPORT virtual std::string groupName();
+ MODELAPI_EXPORT std::string groupName() override;
/// Returns the group identifier of this result
inline static std::string group() {
/// Sets the displayed/hidden state of the object. If it is changed, sends the
/// "redisplay" signal.
- MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay);
+ MODELAPI_EXPORT void setDisplayed(const bool theDisplay) override;
/// To refresh the steps of a field
MODELAPI_EXPORT virtual void updateSteps() = 0;
};
//! Pointer on feature object
-typedef std::shared_ptr<ModelAPI_ResultField> ResultFieldPtr;
-typedef std::shared_ptr<ModelAPI_ResultField::ModelAPI_FieldStep> FieldStepPtr;
+using ResultFieldPtr = std::shared_ptr<ModelAPI_ResultField>;
+using FieldStepPtr = std::shared_ptr<ModelAPI_ResultField::ModelAPI_FieldStep>;
#endif
*/
class ModelAPI_ResultGroup : public ModelAPI_Result {
public:
- MODELAPI_EXPORT virtual ~ModelAPI_ResultGroup();
+ MODELAPI_EXPORT ~ModelAPI_ResultGroup() override;
/// Returns the group identifier of this result
- MODELAPI_EXPORT virtual std::string groupName();
+ MODELAPI_EXPORT std::string groupName() override;
/// Returns the group identifier of this result
inline static std::string group() {
};
//! Pointer on feature object
-typedef std::shared_ptr<ModelAPI_ResultGroup> ResultGroupPtr;
+using ResultGroupPtr = std::shared_ptr<ModelAPI_ResultGroup>;
#endif
class ModelAPI_ResultParameter : public ModelAPI_Result {
public:
/// Returns the group identifier of this result
- virtual std::string groupName() { return group(); }
+ std::string groupName() override { return group(); }
/// Returns the group identifier of this result
inline static std::string group() {
}
/// The generic initialization of attributes
- virtual void initAttributes() = 0;
+ void initAttributes() override = 0;
/// Destructor
- MODELAPI_EXPORT ~ModelAPI_ResultParameter();
+ MODELAPI_EXPORT ~ModelAPI_ResultParameter() override;
};
//! Pointer on feature object
-typedef std::shared_ptr<ModelAPI_ResultParameter> ResultParameterPtr;
+using ResultParameterPtr = std::shared_ptr<ModelAPI_ResultParameter>;
#endif
class ModelAPI_ResultPart : public ModelAPI_Result {
public:
/// Returns the group identifier of this result
- MODELAPI_EXPORT virtual std::string groupName();
+ MODELAPI_EXPORT std::string groupName() override;
/// Returns the group identifier of this result
inline static std::string group() {
};
//! Pointer on feature object
-typedef std::shared_ptr<ModelAPI_ResultPart> ResultPartPtr;
+using ResultPartPtr = std::shared_ptr<ModelAPI_ResultPart>;
#endif
virtual ModelAPI_FiltersFactory *filters() = 0;
/// To virtually destroy the fields of successors
- virtual ~ModelAPI_Session() {}
+ virtual ~ModelAPI_Session() = default;
/// Returns the global identifier of the current transaction (needed for the
/// update algo)
static void setSession(std::shared_ptr<ModelAPI_Session> theManager);
};
-typedef std::shared_ptr<ModelAPI_Session> SessionPtr;
+using SessionPtr = std::shared_ptr<ModelAPI_Session>;
#endif
#define RECURSE_TOP_LEVEL 50
-//#define DEBUG_REMOVE_FEATURES
-//#define DEBUG_REMOVE_FEATURES_RECURSE
-//#define DEBUG_CYCLING_1550
+// #define DEBUG_REMOVE_FEATURES
+// #define DEBUG_REMOVE_FEATURES_RECURSE
+// #define DEBUG_CYCLING_1550
#ifdef DEBUG_REMOVE_FEATURES_RECURSE
#include <sstream>
class MODELAPI_EXPORT ModelAPI_Validator {
public:
// Make virtual destructor in order to make the class polymorphic
- virtual ~ModelAPI_Validator() {}
+ virtual ~ModelAPI_Validator() = default;
};
-typedef std::shared_ptr<ModelAPI_Validator> ValidatorPtr;
+using ValidatorPtr = std::shared_ptr<ModelAPI_Validator>;
/**\class ModelAPI_ValidatorsFactory
* \ingroup DataModel
*/
class MODELAPI_EXPORT ModelAPI_ValidatorsFactory {
public:
- virtual ~ModelAPI_ValidatorsFactory() {}
+ virtual ~ModelAPI_ValidatorsFactory() = default;
/// Registers the instance of the validator by the ID
virtual void registerValidator(const std::string &theID,
const std::list<std::string> &theArguments) = 0;
/// Validators is a list of pairs <Validator, list of arguments>
- typedef std::list<std::pair<std::string, std::list<std::string>>> Validators;
+ using Validators = std::list<std::pair<std::string, std::list<std::string>>>;
/// Provides a validator for the feature, returns NULL if no validator
virtual void validators(const std::string &theFeatureID,
Validators &theResult) const = 0;
protected:
/// Get instance from Session
- ModelAPI_ValidatorsFactory() {}
+ ModelAPI_ValidatorsFactory() = default;
};
#endif
#include <GeomAPI_ShapeExplorer.h>
#include <GeomAPI_Vertex.h>
-//#define DEBUG_POINT_INSIDE_SHAPE
+// #define DEBUG_POINT_INSIDE_SHAPE
#ifdef DEBUG_POINT_INSIDE_SHAPE
#include <iostream>
#endif
class ModelAPI_Object;
class ModelAPI_Result;
-typedef std::shared_ptr<ModelAPI_Document> DocumentPtr;
-typedef std::shared_ptr<ModelAPI_Entity> EntityPtr;
-typedef std::shared_ptr<ModelAPI_Feature> FeaturePtr;
-typedef std::shared_ptr<ModelAPI_Folder> FolderPtr;
-typedef std::shared_ptr<ModelAPI_Result> ResultPtr;
+using DocumentPtr = std::shared_ptr<ModelAPI_Document>;
+using EntityPtr = std::shared_ptr<ModelAPI_Entity>;
+using FeaturePtr = std::shared_ptr<ModelAPI_Feature>;
+using FolderPtr = std::shared_ptr<ModelAPI_Folder>;
+using ResultPtr = std::shared_ptr<ModelAPI_Result>;
-typedef std::set<std::string> ModulesSet;
-typedef std::map<DocumentPtr, std::map<std::string, std::pair<int, int>>>
- NbFeaturesMap;
+using ModulesSet = std::set<std::string>;
+using NbFeaturesMap =
+ std::map<DocumentPtr, std::map<std::string, std::pair<int, int>>>;
/**\class ModelHighAPI_Dumper
* \ingroup CPPHighAPI
*/
class DumpStorage {
public:
- DumpStorage() {}
+ DumpStorage() = default;
MODELHIGHAPI_EXPORT DumpStorage(const DumpStorage &theOther);
MODELHIGHAPI_EXPORT const DumpStorage &
operator=(const DumpStorage &theOther);
- virtual ~DumpStorage() {}
+ virtual ~DumpStorage() = default;
void setFilenameSuffix(const std::string &theSuffix) {
myFilenameSuffix = theSuffix;
friend class ModelHighAPI_Dumper;
};
- typedef std::shared_ptr<DumpStorage> DumpStoragePtr;
+ using DumpStoragePtr = std::shared_ptr<DumpStorage>;
/** \class DumpStorageGeom
* \ingroup CPPHighAPI
class DumpStorageGeom : public DumpStorage {
protected:
MODELHIGHAPI_EXPORT
- virtual void
- write(const std::shared_ptr<ModelAPI_AttributeSelection> &theAttrSelect);
+ void write(const std::shared_ptr<ModelAPI_AttributeSelection>
+ &theAttrSelect) override;
};
/** \class DumpStorageWeak
class DumpStorageWeak : public DumpStorage {
protected:
MODELHIGHAPI_EXPORT
- virtual void
- write(const std::shared_ptr<ModelAPI_AttributeSelection> &theAttrSelect);
+ void write(const std::shared_ptr<ModelAPI_AttributeSelection>
+ &theAttrSelect) override;
};
public:
bool myIsDefault; ///< \c true if the name is default
bool myIsDumped; ///< shows that the names of the feature are already stored
- EntityName() {}
+ EntityName() = default;
EntityName(const std::string &theCurName, const std::string &theUserName,
bool theDefault)
: myCurrentName(theCurName), myUserName(theUserName),
myIsDefault(theDefault), myIsDumped(false) {}
};
- typedef std::map<EntityPtr, EntityName> EntityNameMap;
+ using EntityNameMap = std::map<EntityPtr, EntityName>;
struct LastDumpedEntity {
EntityPtr myEntity; ///< last dumped entity
const std::list<ResultPtr> &theResults = std::list<ResultPtr>())
: myEntity(theEntity), myUserName(theUserName), myResults(theResults) {}
};
- typedef std::stack<LastDumpedEntity> DumpStack;
+ using DumpStack = std::stack<LastDumpedEntity>;
static ModelHighAPI_Dumper *mySelf;
const std::shared_ptr<ModelAPI_Feature> &theFeature)
: myFeature(theFeature) {}
-ModelHighAPI_Interface::~ModelHighAPI_Interface() {}
+ModelHighAPI_Interface::~ModelHighAPI_Interface() = default;
//--------------------------------------------------------------------------------------
std::shared_ptr<ModelAPI_Feature> ModelHighAPI_Interface::feature() const {
if (feature().get()) {
std::list<std::shared_ptr<ModelAPI_Result>> aResults = feature()->results();
- for (auto it = aResults.begin(), end = aResults.end(); it != end; ++it) {
- if (!(*it)->isDisabled())
- aSelectionList.push_back(ModelHighAPI_Selection(*it));
+ for (auto &aResult : aResults) {
+ if (!aResult->isDisabled())
+ aSelectionList.push_back(ModelHighAPI_Selection(aResult));
}
}
};
//! Pointer on Interface object
-typedef std::shared_ptr<ModelHighAPI_Interface> InterfacePtr;
+using InterfacePtr = std::shared_ptr<ModelHighAPI_Interface>;
//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
#include <ModelAPI_Feature.h>
#include <ModelAPI_Result.h>
//--------------------------------------------------------------------------------------
-ModelHighAPI_Reference::ModelHighAPI_Reference() {}
+ModelHighAPI_Reference::ModelHighAPI_Reference() = default;
ModelHighAPI_Reference::ModelHighAPI_Reference(
const std::shared_ptr<ModelAPI_Object> &theValue)
}
}
-ModelHighAPI_Reference::~ModelHighAPI_Reference() {}
+ModelHighAPI_Reference::~ModelHighAPI_Reference() = default;
//--------------------------------------------------------------------------------------
void ModelHighAPI_Reference::fillAttribute(
class ModelAPI_FiltersFeature;
class ModelAPI_Result;
//--------------------------------------------------------------------------------------
-typedef std::pair<std::shared_ptr<ModelAPI_Result>,
- std::shared_ptr<GeomAPI_Shape>>
- ResultSubShapePair;
-typedef std::pair<std::string, std::wstring> TypeSubShapeNamePair;
-typedef std::pair<std::string, std::shared_ptr<GeomAPI_Pnt>> TypeInnerPointPair;
-typedef std::pair<std::string, std::pair<std::wstring, int>> TypeWeakNamingPair;
+using ResultSubShapePair =
+ std::pair<std::shared_ptr<ModelAPI_Result>, std::shared_ptr<GeomAPI_Shape>>;
+using TypeSubShapeNamePair = std::pair<std::string, std::wstring>;
+using TypeInnerPointPair = std::pair<std::string, std::shared_ptr<GeomAPI_Pnt>>;
+using TypeWeakNamingPair = std::pair<std::string, std::pair<std::wstring, int>>;
//--------------------------------------------------------------------------------------
/**\class ModelHighAPI_Selection
* \ingroup CPPHighAPI
void initDefault();
};
-typedef ModuleBase_ActionInfo ActionInfo;
+using ActionInfo = ModuleBase_ActionInfo;
#endif /* XGUI_ACTIONINFO_H_ */
class ModuleBase_ActionParameter {
public:
/// Destuctor is added in order to virtualize the class
- virtual ~ModuleBase_ActionParameter() {}
+ virtual ~ModuleBase_ActionParameter() = default;
};
-typedef std::shared_ptr<ModuleBase_ActionParameter> ActionParamPtr;
+using ActionParamPtr = std::shared_ptr<ModuleBase_ActionParameter>;
#endif
#include <ModelAPI_Object.h>
#include <QList>
-typedef QList<int> QIntList; //!< list of int values
-typedef QList<short> QShortList; //!< list of short int values
-typedef QList<double> QDoubleList; //!< list of double values
-typedef QList<ObjectPtr> QObjectPtrList; //!< List of ModelAPI_Objects
+using QIntList = QList<int>; //!< list of int values
+using QShortList = QList<short>; //!< list of short int values
+using QDoubleList = QList<double>; //!< list of double values
+using QObjectPtrList = QList<ObjectPtr>; //!< List of ModelAPI_Objects
#endif
Q_OBJECT
public:
- explicit ModuleBase_DoubleSpinBox(QWidget *theParent = 0,
+ explicit ModuleBase_DoubleSpinBox(QWidget *theParent = nullptr,
int thePrecision = -12);
- virtual ~ModuleBase_DoubleSpinBox();
+ ~ModuleBase_DoubleSpinBox() override;
/// Returns true if the control is clear
bool isCleared() const;
void setPrecision(const int);
/// Set step
- virtual void stepBy(int);
+ void stepBy(int) override;
/// Converts value from string to double
- virtual double valueFromText(const QString &) const;
+ double valueFromText(const QString &) const override;
/// Convert value from double to string
- virtual QString textFromValue(double) const;
+ QString textFromValue(double) const override;
/// Validate current value
- virtual QValidator::State validate(QString &, int &) const;
+ QValidator::State validate(QString &, int &) const override;
/// Imitation of disable control value. If theEnable is false, the control
/// becomes read only and base color is disabled.
class ModuleBase_Filter {
public:
/// Constructor
- MODULEBASE_EXPORT ModuleBase_Filter() {}
+ MODULEBASE_EXPORT ModuleBase_Filter() = default;
/**
* Returns an OCC selection filter. It can be appended into the context of a
class ModuleBase_IWorkshop;
-//#define DEBUG_FILTERS
+// #define DEBUG_FILTERS
/**
* \ingroup GUI
* \param theOwner the result of selection
* \return whether the owner is selectable in the viewer
*/
- Standard_EXPORT virtual Standard_Boolean
- IsOk(const Handle(SelectMgr_EntityOwner) & theOwner) const;
+ Standard_EXPORT Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner) &
+ theOwner) const override;
DEFINE_STANDARD_RTTIEXT(ModuleBase_FilterValidated, SelectMgr_Filter)
protected:
/// \param theParent instance of workshop interface
ModuleBase_IModule(ModuleBase_IWorkshop *theParent);
- virtual ~ModuleBase_IModule();
+ ~ModuleBase_IModule() override;
/// Stores the current selection
virtual void storeSelection() {}
/// \param theMenuActions map of action/menu for the desirable index in the
/// viewer menu \return true if items are added and there is no necessity to
/// provide standard menu
- virtual bool addViewerMenu(const QMap<QString, QAction *> &theStdActions,
- QWidget *theParent,
- QMap<int, QAction *> &theMenuActions) const {
+ virtual bool addViewerMenu(const QMap<QString, QAction *> & /*theStdActions*/,
+ QWidget * /*theParent*/,
+ QMap<int, QAction *> & /*theMenuActions*/) const {
return false;
}
/// \param theWidgetApi the widget configuration.
/// The attribute of the model widget is obtained from
virtual ModuleBase_ModelWidget *
- createWidgetByType(const std::string &theType, QWidget *theParent,
- Config_WidgetAPI *theWidgetApi) {
- return 0;
+ createWidgetByType(const std::string & /*theType*/, QWidget * /*theParent*/,
+ Config_WidgetAPI * /*theWidgetApi*/) {
+ return nullptr;
}
/// Returns the active widget, by default it is the property panel active
/// \param theWidgets a list of created widgets
/// \return boolean result, false by default
virtual bool
- createWidgets(const FeaturePtr &theFeature, const QString &theXmlRepr,
- QList<ModuleBase_ModelWidget *> &theWidgets) const {
+ createWidgets(const FeaturePtr & /*theFeature*/,
+ const QString & /*theXmlRepr*/,
+ QList<ModuleBase_ModelWidget *> & /*theWidgets*/) const {
return false;
}
/// \param theFlag a flag of level of customization, which means that only
/// part of sub-elements \return boolean value
virtual bool
- isCustomPrsActivated(const ModuleBase_CustomizeFlag &theFlag) const {
+ isCustomPrsActivated(const ModuleBase_CustomizeFlag & /*theFlag*/) const {
return false;
};
/// be updated(e.g. only highlighted elements) \param theUpdateViewer the
/// parameter whether the viewer should be update immediately \returns true if
/// the object is modified
- virtual bool customizeFeature(ObjectPtr theObject,
- const ModuleBase_CustomizeFlag &theFlag,
- const bool theUpdateViewer) {
+ virtual bool customizeFeature(ObjectPtr /*theObject*/,
+ const ModuleBase_CustomizeFlag & /*theFlag*/,
+ const bool /*theUpdateViewer*/) {
return false;
}
/// Returns true if the action should be always enabled
/// \param theActionId an action index: Accept or Accept All
/// \return boolean value
- virtual bool isActionEnableStateFixed(const int theActionId) const {
+ virtual bool isActionEnableStateFixed(const int /*theActionId*/) const {
return false;
}
/// Returns true if the event is processed.
/// \param thePreviousAttributeID an index of the previous active attribute
- virtual bool processEnter(const std::string &thePreviousAttributeID) {
+ virtual bool processEnter(const std::string & /*thePreviousAttributeID*/) {
return false;
};
//! This function must return a new module instance.
extern "C" {
-typedef ModuleBase_IModule *(*CREATE_FUNC)(ModuleBase_IWorkshop *);
+using CREATE_FUNC = ModuleBase_IModule *(*)(ModuleBase_IWorkshop *);
}
#define CREATE_MODULE "createModule"
/// Types of the selection place, where the selection is obtained
enum SelectionPlace { Browser, Viewer, AllControls };
- virtual ~ModuleBase_ISelection() {}
+ virtual ~ModuleBase_ISelection() = default;
/// Returns a list of viewer selected presentations
/// \return list of presentations
: myWorkshop(theWorkshop) {}
/// Destructor
- virtual ~ModuleBase_ISelectionActivate() {}
+ virtual ~ModuleBase_ISelectionActivate() = default;
/// Updates active selection modes in the viewer depending on the application
/// state
#include "ModuleBase_IViewWindow.h"
-ModuleBase_IViewWindow::ModuleBase_IViewWindow() {}
+ModuleBase_IViewWindow::ModuleBase_IViewWindow() = default;
-ModuleBase_IViewWindow::~ModuleBase_IViewWindow() {}
+ModuleBase_IViewWindow::~ModuleBase_IViewWindow() = default;
/// Returns a scale factor of the given view
/// \param theView a view object
- const double Scale(const Handle(V3d_View) & theView) {
+ double Scale(const Handle(V3d_View) & theView) {
if (!myWindowScale.contains(theView))
myWindowScale.insert(theView, theView->Camera()->Scale());
return myWindowScale[theView];
//! Type for mapping from text to color to display the names lines in
//! different colors
- typedef std::list<std::pair<std::wstring, std::vector<int>>> TextColor;
+ using TextColor = std::list<std::pair<std::wstring, std::vector<int>>>;
//! Sets the text displayed in right-top corner of the 3D view
//! \param theText the text to display, or empty string to erase presentation;
/// \param theParent parent object
ModuleBase_IWorkshop(QObject *theParent);
- virtual ~ModuleBase_IWorkshop() {}
+ ~ModuleBase_IWorkshop() override = default;
/// Return current selection instance
virtual ModuleBase_ISelection *selection() const = 0;
*/
class MODULEBASE_EXPORT ModuleBase_IconFactory {
public:
- virtual ~ModuleBase_IconFactory() {}
+ virtual ~ModuleBase_IconFactory() = default;
/// Returns icons factory instance
static ModuleBase_IconFactory *get();
public:
/// Constructor
/// \param theParent a parent widget
- explicit ModuleBase_IntSpinBox(QWidget *theParent = 0);
- virtual ~ModuleBase_IntSpinBox(){};
+ explicit ModuleBase_IntSpinBox(QWidget *theParent = nullptr);
+ ~ModuleBase_IntSpinBox() override = default;
+ ;
protected:
/// Called on key press event
- virtual void keyPressEvent(QKeyEvent *theEvent);
+ void keyPressEvent(QKeyEvent *theEvent) override;
};
#endif
const QString &theToolTip = "",
const QString &theIcon = "", int thePrecision = -12);
- virtual ~ModuleBase_LabelValue();
+ ~ModuleBase_LabelValue() override;
/// Fills the label value with the given value
/// \param theValue a value
#include <QLabel>
#include <QTextCodec>
-//#define DEBUG_VALUE_STATE
+// #define DEBUG_VALUE_STATE
-//#define DEBUG_WIDGET_INSTANCE
-//#define DEBUG_ENABLE_SKETCH_INPUT_FIELDS
+// #define DEBUG_WIDGET_INSTANCE
+// #define DEBUG_ENABLE_SKETCH_INPUT_FIELDS
//**************************************************************
ModuleBase_ModelWidget::ModuleBase_ModelWidget(QWidget *theParent,
/// is obtained from a low-level API for reading xml definitions of widgets
ModuleBase_ModelWidget(QWidget *theParent, const Config_WidgetAPI *theData);
/// Destructor
- virtual ~ModuleBase_ModelWidget();
+ ~ModuleBase_ModelWidget() override;
/// Fills the widget with default values. It calls the resetCustom method and
/// change the widget state to Reset if the reset is performed. \return true
/// \param theToValidate the boolean value whether the value should be checked
/// by filters
virtual bool
- setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>> &theValues,
- const bool theToValidate) {
+ setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>> & /*theValues*/,
+ const bool /*theToValidate*/) {
return false;
}
/// \param theValue a selected presentation in the view
/// \return a boolean value
virtual bool isValidSelectionCustom(
- const std::shared_ptr<ModuleBase_ViewerPrs> &theValue) {
+ const std::shared_ptr<ModuleBase_ViewerPrs> & /*theValue*/) {
return true;
}
QWidget *getControlAcceptingFocus(const bool isFirst);
/// FocusIn events processing
- virtual bool eventFilter(QObject *theObject, QEvent *theEvent);
+ bool eventFilter(QObject *theObject, QEvent *theEvent) override;
/// \brief Enables processing of focus event on all controls by the widget
/// if this widget is not obligatory and set no-focus policy otherwise
/// returns empty list. \param theActionType type of action. It can be
/// ActionUndo or ActionRedo.
virtual QList<ActionInfo>
- actionsList(ModuleBase_ActionType theActionType) const {
+ actionsList(ModuleBase_ActionType /*theActionType*/) const {
return QList<ActionInfo>();
}
/// Constructor
/// \param theId the operation identifier
/// \param theParent the QObject parent
- ModuleBase_Operation(const QString &theId = "", QObject *theParent = 0);
+ ModuleBase_Operation(const QString &theId = "", QObject *theParent = nullptr);
/// Destructor
- virtual ~ModuleBase_Operation();
+ ~ModuleBase_Operation() override;
/// Returns the operation description
/// /returns the instance of the description class
#include <ModelAPI_AttributeRefList.h>
#endif
-//#define DEBUG_OPERATION_START
+// #define DEBUG_OPERATION_START
#ifdef _DEBUG
#include <QDebug>
/// \param theId the operation identifier
/// \param theParent the QObject parent
ModuleBase_OperationFeature(const QString &theId = "",
- QObject *theParent = 0);
+ QObject *theParent = nullptr);
/// Destructor
- virtual ~ModuleBase_OperationFeature();
+ ~ModuleBase_OperationFeature() override;
/// Returns True id the current operation is launched in editing mode
bool isEditOperation() const { return myIsEditing; }
/// Must return True if the operation's feature is valid.
/// Since IOperation does not have any feature returns false.
- virtual bool isValid() const;
+ bool isValid() const override;
/// Sets the operation feature
void setFeature(FeaturePtr theFeature);
/// \brief Set property pane to the operation
/// \param theProp a property panel instance
- virtual void setPropertyPanel(ModuleBase_IPropertyPanel *theProp);
+ void setPropertyPanel(ModuleBase_IPropertyPanel *theProp) override;
// \return Currently installed property panel
// ModuleBase_IPropertyPanel* propertyPanel() const { return myPropertyPanel;
/// in using this method. It would be better to inherit own operator from base
/// one and redefine startOperation method instead. \return true if the start
/// is successful
- virtual bool start();
+ bool start() override;
/// Aborts operation
/// Public slot. Aborts operation. This slot is not virtual and cannot be
/// redefined. Redefine abortOperation method to change behavior of operation
/// instead
- void abort();
+ void abort() override;
/// Commits operation
/// Public slot. Commits operation. This slot is not virtual and cannot be
/// redefined. Redefine commitOperation method to change behavior of operation
/// instead
- bool commit();
+ bool commit() override;
protected:
/// Displays the feature/results if it is hidden. It will be hided in
/// stopOperation
- virtual void startOperation();
+ void startOperation() override;
/// Hide feature/results if they were hided on start
- virtual void stopOperation();
+ void stopOperation() override;
/// Virtual method called after operation resume (see resume() method for more
/// description)
- virtual void resumeOperation();
+ void resumeOperation() override;
/// Creates an operation new feature
/// \param theFlushMessage the flag whether the create message should be
#include <string>
ModuleBase_ParamIntSpinBox::ModuleBase_ParamIntSpinBox(QWidget *theParent)
- : ModuleBase_IntSpinBox(theParent), myAcceptVariables(true) {
+ : ModuleBase_IntSpinBox(theParent) {
connectSignalsAndSlots();
}
/*!
\brief Destructor.
*/
-ModuleBase_ParamIntSpinBox::~ModuleBase_ParamIntSpinBox() {}
+ModuleBase_ParamIntSpinBox::~ModuleBase_ParamIntSpinBox() = default;
/*!
\brief Perform \a steps increment/decrement steps.
\param theParent a parent object
*/
- explicit ModuleBase_ParamIntSpinBox(QWidget *theParent = 0);
- virtual ~ModuleBase_ParamIntSpinBox();
+ explicit ModuleBase_ParamIntSpinBox(QWidget *theParent = nullptr);
+ ~ModuleBase_ParamIntSpinBox() override;
- virtual void stepBy(int);
+ void stepBy(int) override;
/// Convert Int value from text string
- virtual int valueFromText(const QString &) const;
+ int valueFromText(const QString &) const override;
/// Convert text string from int value
- virtual QString textFromValue(int) const;
+ QString textFromValue(int) const override;
/// Validate the value
- virtual QValidator::State validate(QString &, int &) const;
+ QValidator::State validate(QString &, int &) const override;
/// Set current int value
virtual void setValue(int);
bool findVariable(const QString &theName, double &outValue) const;
protected:
- virtual void showEvent(QShowEvent *);
+ void showEvent(QShowEvent *) override;
protected slots:
/// A slot called on text change
private:
QString myTextValue;
- bool myAcceptVariables;
+ bool myAcceptVariables{true};
};
#endif
\param theParent a parent object
\param thePrecision a precision of values display
*/
- ModuleBase_ParamSpinBox(QWidget *theParent = 0, int thePrecision = 12);
+ ModuleBase_ParamSpinBox(QWidget *theParent = nullptr, int thePrecision = 12);
/// Set list of completion strings
void setCompletionList(QStringList &);
- virtual ~ModuleBase_ParamSpinBox();
+ ~ModuleBase_ParamSpinBox() override;
- virtual void stepBy(int);
+ void stepBy(int) override;
// virtual double valueFromText(const QString&) const;
// virtual QString textFromValue (double value) const;
- virtual QValidator::State validate(QString &, int &) const;
+ QValidator::State validate(QString &, int &) const override;
virtual void setValue(double);
/*!
\brief This function is called when the spinbox receives key release event.
*/
- virtual void keyReleaseEvent(QKeyEvent *event);
+ void keyReleaseEvent(QKeyEvent *event) override;
- virtual bool eventFilter(QObject *theObj, QEvent *theEvent);
+ bool eventFilter(QObject *theObj, QEvent *theEvent) override;
/// The virtual function is reimplemented in order to avoid extra increasing
/// of value by StepBy method
- virtual void timerEvent(QTimerEvent * /*event*/) {}
+ void timerEvent(QTimerEvent * /*event*/) override {}
- virtual StepEnabled stepEnabled() const {
+ StepEnabled stepEnabled() const override {
return StepUpEnabled | StepDownEnabled;
}
//
#include "ModuleBase_Preferences.h"
-//#include "ModuleBase_Constants.h"
+// #include "ModuleBase_Constants.h"
#include <Config_PropManager.h>
Standard_EXPORT ModuleBase_ResultPrs(ResultPtr theResult);
//! Method which draws selected owners ( for fast presentation draw )
- Standard_EXPORT virtual void
+ Standard_EXPORT void
HilightSelected(const Handle(PrsMgr_PresentationManager3d) & thePM,
- const SelectMgr_SequenceOfOwner &theOwners);
+ const SelectMgr_SequenceOfOwner &theOwners) override;
//! Method which hilight an owner belonging to
//! this selectable object ( for fast presentation draw )
- Standard_EXPORT virtual void
- HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d) & thePM,
- const Handle(Prs3d_Drawer) & theStyle,
- const Handle(SelectMgr_EntityOwner) & theOwner);
+ Standard_EXPORT void HilightOwnerWithColor(
+ const Handle(PrsMgr_PresentationManager3d) & thePM,
+ const Handle(Prs3d_Drawer) & theStyle,
+ const Handle(SelectMgr_EntityOwner) & theOwner) override;
/// Returns result object
Standard_EXPORT ResultPtr getResult() const { return myResult; }
Standard_EXPORT void setAdditionalSelectionPriority(const int thePriority);
//! Updates color of sub shape drawer
- Standard_EXPORT virtual void SetColor(const Quantity_Color &theColor);
+ Standard_EXPORT void SetColor(const Quantity_Color &theColor) override;
/// Change presentation to have given shape hidden.
/// It suports FACE type of the shape to be hidden.
protected:
/// Redefinition of virtual function
- Standard_EXPORT virtual void
+ Standard_EXPORT void
Compute(const Handle(PrsMgr_PresentationManager3d) & thePresentationManager,
const Handle(Prs3d_Presentation) & thePresentation,
- const Standard_Integer theMode = 0);
+ const Standard_Integer theMode = 0) override;
/// Redefinition of virtual function
- Standard_EXPORT virtual void
+ Standard_EXPORT void
ComputeSelection(const Handle(SelectMgr_Selection) & aSelection,
- const Standard_Integer theMode);
+ const Standard_Integer theMode) override;
private:
/// If the shape of this presentation is Vertex, it appends custom sensitive
const double tolerance = 1e-7;
const double DEFAULT_DEVIATION_COEFFICIENT = 1.e-4;
-//#define DEBUG_ACTIVATE_WINDOW
-//#define DEBUG_SET_FOCUS
+// #define DEBUG_ACTIVATE_WINDOW
+// #define DEBUG_SET_FOCUS
#ifdef WIN32
#define FSEP "\\"
/// used
MODULEBASE_EXPORT QAction *
createAction(const QIcon &theIcon, const QString &theText, QObject *theParent,
- const QObject *theReceiver = 0, const char *theMember = "",
+ const QObject *theReceiver = nullptr, const char *theMember = "",
const QString &theToolTip = QString(),
const QString &theStatusTip = QString());
MODULEBASE_EXPORT
ModuleBase_ViewerPrs(ObjectPtr theResult = ObjectPtr(),
const GeomShapePtr &theShape = GeomShapePtr(),
- Handle(SelectMgr_EntityOwner) theOwner = NULL);
+ Handle(SelectMgr_EntityOwner) theOwner = nullptr);
/// Destructor
MODULEBASE_EXPORT virtual ~ModuleBase_ViewerPrs();
Handle(AIS_InteractiveObject) myInteractive; /// interactive object
};
-typedef std::shared_ptr<ModuleBase_ViewerPrs> ModuleBase_ViewerPrsPtr;
+using ModuleBase_ViewerPrsPtr = std::shared_ptr<ModuleBase_ViewerPrs>;
#endif
myPickConcealedParents =
aPickParents == "1" || aPickParents == "true" || aPickParents == "yes";
- QGridLayout *aMainLay = new QGridLayout(this);
+ auto *aMainLay = new QGridLayout(this);
ModuleBase_Tools::adjustMargins(aMainLay);
myView = new QTableWidget(this);
myView->verticalHeader()->setVisible(false);
}
-ModuleBase_WidgetConcealedObjects::~ModuleBase_WidgetConcealedObjects() {}
+ModuleBase_WidgetConcealedObjects::~ModuleBase_WidgetConcealedObjects() =
+ default;
bool ModuleBase_WidgetConcealedObjects::storeValueCustom() {
if (!myFeature)
if (myFeature) {
anObject =
ModuleBase_Tools::getObject(myFeature->attribute(myBaseShapeAttribute));
- if (anObject.get() != NULL)
+ if (anObject.get() != nullptr)
aBaseFeature = ModelAPI_Feature::feature(anObject);
}
if (myBaseFeature != aBaseFeature) {
int anId = myView->rowCount();
myView->setRowCount(anId + 1);
- QWidget *aVisibilityWdg = new QWidget(this);
- QVBoxLayout *aVisibilityLay = new QVBoxLayout(aVisibilityWdg);
+ auto *aVisibilityWdg = new QWidget(this);
+ auto *aVisibilityLay = new QVBoxLayout(aVisibilityWdg);
aVisibilityLay->setContentsMargins(2, 2, 2, 2);
- QCheckBox *aVisibilityBtn = new QCheckBox(aVisibilityWdg);
+ auto *aVisibilityBtn = new QCheckBox(aVisibilityWdg);
aVisibilityLay->addWidget(aVisibilityBtn, 0, Qt::AlignHCenter);
connect(aVisibilityBtn, SIGNAL(toggled(bool)), this,
SLOT(onItemToggled(bool)));
/// \param theData the widget configuration.
ModuleBase_WidgetConcealedObjects(QWidget *theParent,
const Config_WidgetAPI *theData);
- virtual ~ModuleBase_WidgetConcealedObjects();
+ ~ModuleBase_WidgetConcealedObjects() override;
/// Redefinition of virtual method
- virtual QList<QWidget *> getControls() const;
+ QList<QWidget *> getControls() const override;
/// The widget can not accept focus
- virtual bool canAcceptFocus() const { return false; };
+ bool canAcceptFocus() const override { return false; };
protected:
/// Saves the internal parameters to the given feature
/// \return True in success
- virtual bool storeValueCustom();
+ bool storeValueCustom() override;
/// Redefinition of virtual method
- virtual bool restoreValueCustom();
+ bool restoreValueCustom() override;
private:
/// Creates a row in view
QWidget *theParent, ModuleBase_IWorkshop *theWorkshop,
const Config_WidgetAPI *theData)
: ModuleBase_WidgetValidated(theParent, theWorkshop, theData) {
- QFormLayout *aLayout = new QFormLayout(this);
+ auto *aLayout = new QFormLayout(this);
ModuleBase_Tools::adjustMargins(aLayout);
QString aLabelText = translate(theData->widgetLabel());
}
//********************************************************************
-ModuleBase_WidgetFeatureSelector::~ModuleBase_WidgetFeatureSelector() {}
+ModuleBase_WidgetFeatureSelector::~ModuleBase_WidgetFeatureSelector() = default;
//********************************************************************
bool ModuleBase_WidgetFeatureSelector::setSelectionCustom(
// In order to make reselection possible, set empty object and shape should
// be done
setSelectionCustom(std::shared_ptr<ModuleBase_ViewerPrs>(
- new ModuleBase_ViewerPrs(ObjectPtr(), GeomShapePtr(), NULL)));
+ new ModuleBase_ViewerPrs(ObjectPtr(), GeomShapePtr(), nullptr)));
return false;
}
// it removes the processed value from the parameters list
ObjectPtr anObject =
ModuleBase_Tools::getObject(myFeature->attribute(attributeID()));
- if (anObject.get() != NULL) {
+ if (anObject.get() != nullptr) {
std::wstring aName = anObject->data()->name();
myTextLine->setText(QString::fromStdWString(aName));
} else {
ModuleBase_IWorkshop *theWorkshop,
const Config_WidgetAPI *theData);
- virtual ~ModuleBase_WidgetFeatureSelector();
+ ~ModuleBase_WidgetFeatureSelector() override;
/// Set the given wrapped value to the current widget
/// This value should be processed in the widget according to the needs
/// preselection. It is redefined to check the value validity and if it is,
/// fill the attribute with by value \param theValues the wrapped selection
/// values \param theToValidate a flag on validation of the values
- virtual bool
- setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>> &theValues,
- const bool theToValidate);
+ bool setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>> &theValues,
+ const bool theToValidate) override;
/// Fills given container with selection modes if the widget has it
/// \param [out] theModuleSelectionModes module additional modes, -1 means all
/// default modes \param theModes [out] a container of modes
- virtual void selectionModes(int &theModuleSelectionModes, QIntList &theModes);
+ void selectionModes(int &theModuleSelectionModes,
+ QIntList &theModes) override;
/// Returns list of widget controls
/// \return a control list
- virtual QList<QWidget *> getControls() const;
+ QList<QWidget *> getControls() const override;
/// Fills the attribute with the value of the selected owner
/// \param thePrs a selected owner
- virtual bool
- setSelectionCustom(const std::shared_ptr<ModuleBase_ViewerPrs> &thePrs);
+ bool setSelectionCustom(
+ const std::shared_ptr<ModuleBase_ViewerPrs> &thePrs) override;
protected:
/// The method called when widget is activated
- virtual void activateCustom();
+ void activateCustom() override;
/// Saves the internal parameters to the given feature
/// \return True in success
- virtual bool storeValueCustom();
+ bool storeValueCustom() override;
- virtual bool restoreValueCustom();
+ bool restoreValueCustom() override;
/// Computes and updates name of selected object in the widget
virtual void updateSelectionName();
/// Checks whether all active viewer filters validate the presentation
/// \param thePrs a selected presentation in the view
/// \return a boolean value
- virtual bool
- isValidInFilters(const std::shared_ptr<ModuleBase_ViewerPrs> &thePrs);
+ bool isValidInFilters(
+ const std::shared_ptr<ModuleBase_ViewerPrs> &thePrs) override;
/// Emits model changed info, updates the current control by selection change
/// \param theDone a state whether the selection is set
protected:
/// Returns true if envent is processed.
- virtual bool processSelection();
+ bool processSelection() override;
//----------- Class members -------------
protected:
#include <memory>
#include <string>
-//#define DEBUG_UNDO_REDO
+// #define DEBUG_UNDO_REDO
#ifdef DEBUG_UNDO_REDO
void printHistoryInfo(const QString &theMethodName, int theCurrentHistoryIndex,
ModuleBase_IWorkshop *theWorkshop,
const Config_WidgetAPI *theData);
- virtual ~ModuleBase_WidgetSelector();
+ ~ModuleBase_WidgetSelector() override;
/// Fills given container with selection modes if the widget has it
/// \param [out] theModuleSelectionModes module additional modes, -1 means all
/// default modes \param [out] theModes a container of modes
- virtual void selectionModes(int &theModuleSelectionModes, QIntList &theModes);
+ void selectionModes(int &theModuleSelectionModes,
+ QIntList &theModes) override;
/// Defines if it is supposed that the widget should interact with the viewer.
- virtual bool isViewerSelector() { return true; }
+ bool isViewerSelector() override { return true; }
/// Activate or deactivate selection and selection filters
virtual void updateSelectionModesAndFilters(bool toActivate);
/// Checks the widget validity. By default, it returns true.
/// \param thePrs a selected presentation in the view
/// \return a boolean value
- virtual bool
- isValidSelectionCustom(const std::shared_ptr<ModuleBase_ViewerPrs> &thePrs);
+ bool isValidSelectionCustom(
+ const std::shared_ptr<ModuleBase_ViewerPrs> &thePrs) override;
/// Fills the attribute with the value of the selected owner
/// \param thePrs a selected owner
- virtual bool
- setSelectionCustom(const std::shared_ptr<ModuleBase_ViewerPrs> &thePrs);
+ bool setSelectionCustom(
+ const std::shared_ptr<ModuleBase_ViewerPrs> &thePrs) override;
/// The methiod called when widget is deactivated
- virtual void deactivate();
+ void deactivate() override;
/// Return the attribute values wrapped in a list of viewer presentations
/// \return a list of viewer presentations, which contains an attribute result
protected:
/// Returns true if envent is processed. The default implementation is empty,
/// returns false.
- virtual bool processSelection();
+ bool processSelection() override;
/// Emits model changed info, updates the current control by selection change
/// \param theDone a state whether the selection is set
virtual void updateSelectionName(){};
/// The methiod called when widget is activated
- virtual void activateCustom();
+ void activateCustom() override;
/// Returns true if selected shape corresponds to requested shape types.
/// If the widget type of shapes contains the faces item, the result is
#include <QWidget>
-//#define DEBUG_VALID_STATE
+// #define DEBUG_VALID_STATE
ModuleBase_WidgetValidated::ModuleBase_WidgetValidated(
QWidget *theParent, ModuleBase_IWorkshop *theWorkshop,
class ModelAPI_Validator;
class Config_WidgetAPI;
-//#define LIST_OF_VALID_PRS
+// #define LIST_OF_VALID_PRS
/**
* \ingroup GUI
ModuleBase_WidgetValidated(QWidget *theParent,
ModuleBase_IWorkshop *theWorkshop,
const Config_WidgetAPI *theData);
- virtual ~ModuleBase_WidgetValidated();
+ ~ModuleBase_WidgetValidated() override;
/// Checks all widget validator if the owner is valid. Firstly it checks
/// custom widget validating, next, the attribute's validating. It trying on
ObjectPtr findPresentedObject(const AISObjectPtr &theAIS) const;
/// The method called when widget is deactivated
- virtual void deactivate();
+ void deactivate() override;
//! Clear all validated cash in the widget
void clearValidatedCash();
/// Appends into container of workshop selection filters
/// \param [out] theModuleSelectionFilters module additional modes, -1 means
/// all default modes \param [out] selection filters
- virtual void selectionFilters(QIntList &theModuleSelectionFilters,
- SelectMgr_ListOfFilter &theSelectionFilters);
+ void selectionFilters(QIntList &theModuleSelectionFilters,
+ SelectMgr_ListOfFilter &theSelectionFilters) override;
/// Block the model flush of update and intialization of attribute
/// \param theAttribute an attribute of blocking
/// Checks the widget validity. By default, it returns true.
/// \param thePrs a selected presentation in the view
/// \return a boolean value
- virtual bool
- isValidSelectionCustom(const std::shared_ptr<ModuleBase_ViewerPrs> &thePrs);
+ bool isValidSelectionCustom(
+ const std::shared_ptr<ModuleBase_ViewerPrs> &thePrs) override;
/// Fills the attribute with the value of the selected owner
/// \param thePrs a selected owner
PartSet_BSplineWidget::PartSet_BSplineWidget(QWidget *theParent,
const Config_WidgetAPI *theData)
: ModuleBase_ModelWidget(theParent, theData) {
- QVBoxLayout *aMainLayout = new QVBoxLayout(this);
+ auto *aMainLayout = new QVBoxLayout(this);
aMainLayout->setContentsMargins(0, 0, 0, 0);
// GroupBox to keep widgets for B-spline poles and weights
myPolesGroupBox = new QGroupBox(translate("Poles and weights"), this);
aMainLayout->addWidget(myPolesGroupBox);
- QVBoxLayout *aLayout = new QVBoxLayout(myPolesGroupBox);
+ auto *aLayout = new QVBoxLayout(myPolesGroupBox);
ModuleBase_Tools::adjustMargins(aLayout);
myScrollArea = new QScrollArea(myPolesGroupBox);
myScrollArea->setFrameStyle(QFrame::NoFrame);
aLayout->addWidget(myScrollArea);
- QWidget *aContainer = new QWidget(myScrollArea);
- QVBoxLayout *aBoxLay = new QVBoxLayout(aContainer);
+ auto *aContainer = new QWidget(myScrollArea);
+ auto *aBoxLay = new QVBoxLayout(aContainer);
aBoxLay->setContentsMargins(0, 0, 0, 0);
// layout of GroupBox
myPolesWgt = new QWidget(aContainer);
- QGridLayout *aGroupLayout = new QGridLayout(myPolesWgt);
+ auto *aGroupLayout = new QGridLayout(myPolesWgt);
aGroupLayout->setColumnStretch(1, 1);
ModuleBase_Tools::adjustMargins(aGroupLayout);
AttributeDoubleArrayPtr aWeightsArray =
aData->realArray(SketchPlugin_BSpline::WEIGHTS_ID());
- std::list<BSplinePoleWidgets>::const_iterator anIt = myPoles.begin();
+ auto anIt = myPoles.begin();
for (int anIndex = 0; anIt != myPoles.end(); ++anIndex, ++anIt) {
double aWeight = anIt->myWeight->value();
if (aWeight < THE_MIN_WEIGHT)
while ((int)myPoles.size() < aPoles->size())
addPoleWidget();
- std::list<BSplinePoleWidgets>::iterator anIt = myPoles.begin();
+ auto anIt = myPoles.begin();
for (int anIndex = 0; anIt != myPoles.end(); ++anIt, ++anIndex) {
GeomPnt2dPtr aPoint = aPoles->pnt(anIndex);
anIt->myX->setValue(aPoint->x());
}
void PartSet_BSplineWidget::addPoleWidget() {
- QGridLayout *aGroupLay = dynamic_cast<QGridLayout *>(myPolesWgt->layout());
+ auto *aGroupLay = dynamic_cast<QGridLayout *>(myPolesWgt->layout());
int aNbPoles = (int)myPoles.size();
QString aPoleStr = translate("Pole %1").arg(aNbPoles + 1);
QGroupBox *PartSet_BSplineWidget::createPoleWidget(BSplinePoleWidgets &thePole,
const QString &theName,
QWidget *theParent) {
- QGroupBox *aPoleGroupBox = new QGroupBox(theName, theParent);
- QGridLayout *aPoleLay = new QGridLayout(aPoleGroupBox);
+ auto *aPoleGroupBox = new QGroupBox(theName, theParent);
+ auto *aPoleLay = new QGridLayout(aPoleGroupBox);
aPoleLay->setSpacing(0);
ModuleBase_Tools::zeroMargins(aPoleLay);
/// is obtained from
PartSet_BSplineWidget(QWidget *theParent, const Config_WidgetAPI *theData);
- virtual ~PartSet_BSplineWidget() {}
+ ~PartSet_BSplineWidget() override = default;
/// The methiod called when widget is deactivated
- virtual void deactivate();
+ void deactivate() override;
/// Returns list of widget controls
/// \return a control list
- virtual QList<QWidget *> getControls() const;
+ QList<QWidget *> getControls() const override;
/// Set feature which is processing by active operation
/// \param theFeature a feature object
/// \param theToStoreValue a value about necessity to store the widget value
/// to the feature \param isUpdateFlushed a flag if update should be flushed
/// on store value
- virtual void setFeature(const FeaturePtr &theFeature,
- const bool theToStoreValue = false,
- const bool isUpdateFlushed = true);
+ void setFeature(const FeaturePtr &theFeature,
+ const bool theToStoreValue = false,
+ const bool isUpdateFlushed = true) override;
protected:
/// Saves the internal parameters to the given feature
/// \return True in success
- virtual bool storeValueCustom();
+ bool storeValueCustom() override;
/// Restore value from attribute data to the widget's control
- virtual bool restoreValueCustom();
+ bool restoreValueCustom() override;
/// Create group of widgets related to coordinates of pole and its weight
void addPoleWidget();
#include <AIS_InteractiveObject.hxx>
#include <Prs3d_PointAspect.hxx>
-//#define DO_NOT_VISUALIZE_CUSTOM_PRESENTATION
+// #define DO_NOT_VISUALIZE_CUSTOM_PRESENTATION
PartSet_CustomPrs::PartSet_CustomPrs(ModuleBase_IWorkshop *theWorkshop)
- : myWorkshop(theWorkshop), myFeature(FeaturePtr()),
- myPresentationIsEmpty(false), myDisabledMode(-1) {
+ : myWorkshop(theWorkshop), myFeature(FeaturePtr()) {
Events_Loop *aLoop = Events_Loop::loop();
aLoop->registerListener(
this, Events_Loop::eventByName(EVENT_EMPTY_OPERATION_PRESENTATION));
Quantity_Color aShapeColor = getShapeColor(theFlag);
anOperationPrs->setShapeColor(aShapeColor);
- PartSet_Module *aModule =
- dynamic_cast<PartSet_Module *>(myWorkshop->module());
+ auto *aModule = dynamic_cast<PartSet_Module *>(myWorkshop->module());
XGUI_Workshop *aWorkshop = workshop();
aRedisplayed = aWorkshop->displayer()->displayAIS(
myPresentations[theFlag], false /*load object in selection*/, 0,
}
bool PartSet_CustomPrs::redisplay(
- const ObjectPtr &theObject,
+ const ObjectPtr & /*theObject*/,
const ModuleBase_IModule::ModuleBase_CustomizeFlag &theFlag,
const bool theUpdateViewer) {
#ifdef DO_NOT_VISUALIZE_CUSTOM_PRESENTATION
}
XGUI_Workshop *PartSet_CustomPrs::workshop() const {
- XGUI_ModuleConnector *aConnector =
- dynamic_cast<XGUI_ModuleConnector *>(myWorkshop);
+ auto *aConnector = dynamic_cast<XGUI_ModuleConnector *>(myWorkshop);
return aConnector->workshop();
}
/// Constructor
/// \param theWorkshop a reference to workshop
PARTSET_EXPORT PartSet_CustomPrs(ModuleBase_IWorkshop *theWorkshop);
- PARTSET_EXPORT virtual ~PartSet_CustomPrs(){};
+ PARTSET_EXPORT ~PartSet_CustomPrs() override = default;
+ ;
/// Returns true if the presentation is active
/// \param theFlag an object AIS presentation type
//! Redefinition of Events_Listener method to listen a moment that the
//! presentation becomes empty
- virtual void processEvent(const std::shared_ptr<Events_Message> &theMessage);
+ void processEvent(const std::shared_ptr<Events_Message> &theMessage) override;
private:
/// Creates the AIS operation presentation
void clearErrorShape();
private:
- ModuleBase_IWorkshop *myWorkshop; /// current workshop
- FeaturePtr myFeature; /// Reference to a feature object
- bool myPresentationIsEmpty; /// Boolean state about empty presentation
+ ModuleBase_IWorkshop *myWorkshop; /// current workshop
+ FeaturePtr myFeature; /// Reference to a feature object
+ bool myPresentationIsEmpty{false}; /// Boolean state about empty presentation
/// map of presentation type to AIS object
QMap<ModuleBase_IModule::ModuleBase_CustomizeFlag, AISObjectPtr>
myPresentations;
/// State whether the presentation is activated/deactivated
QMap<ModuleBase_IModule::ModuleBase_CustomizeFlag, bool> myIsActive;
- int myDisabledMode;
+ int myDisabledMode{-1};
Handle(AIS_Shape) myErrorShapes;
};
#include <TopoDS.hxx>
PartSet_MenuMgr::PartSet_MenuMgr(PartSet_Module *theModule)
- : QObject(theModule), myModule(theModule), myPrevId(-1) {
+ : QObject(theModule), myModule(theModule) {
createActions();
}
QAction *PartSet_MenuMgr::action(const QString &theId) const {
if (myActions.contains(theId))
return myActions[theId];
- return 0;
+ return nullptr;
}
void PartSet_MenuMgr::addAction(const QString &theId, QAction *theAction) {
}
void PartSet_MenuMgr::onAction(bool isChecked) {
- QAction *aAction = static_cast<QAction *>(sender());
+ auto *aAction = static_cast<QAction *>(sender());
QString anId = aAction->data().toString();
if (anId == "AUXILIARY_CMD") {
FeaturePtr aFeature;
foreach (ModuleBase_ViewerPrsPtr aPrs, aPrsList) {
aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aPrs->object());
- if (aResult.get() != NULL) {
+ if (aResult.get() != nullptr) {
const GeomShapePtr &aShape = aPrs->shape();
if (aShape.get() && aShape->isEqual(aResult->shape()))
hasFeature = true;
hasAttribute = true;
} else {
aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aPrs->object());
- hasFeature = (aFeature.get() != NULL);
+ hasFeature = (aFeature.get() != nullptr);
}
}
// Find 2d coordinates
FeaturePtr aSketchFea = myModule->sketchMgr()->activeSketch();
if (aSketchFea->getKind() == SketchPlugin_Sketch::ID()) {
- const TopoDS_Shape &aTDShape = aShape->impl<TopoDS_Shape>();
+ const auto &aTDShape = aShape->impl<TopoDS_Shape>();
gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aTDShape));
std::shared_ptr<GeomAPI_Pnt> aPnt3d(
new GeomAPI_Pnt(aPnt.X(), aPnt.Y(), aPnt.Z()));
FeaturePtr aCoincident = PartSet_Tools::findFirstCoincidence(
ModelAPI_Feature::feature(aObj), aSelPnt);
// If we have coincidence then add Detach menu
- if (aCoincident.get() != NULL) {
+ if (aCoincident.get() != nullptr) {
QList<FeaturePtr> aCoins;
mySelectedFeature = aCoincident;
QList<bool> anIsAttributes;
SketchPlugin_ConstraintCoincidence::ENTITY_B(), anIsAttributes);
if (myCoinsideLines.size() > 0) {
aIsDetach = true;
- QMenu *aSubMenu = new QMenu(tr("Detach"), theParent);
+ auto *aSubMenu = new QMenu(tr("Detach"), theParent);
theMenuActions[anIndex++] = aSubMenu->menuAction();
QAction *aAction;
int i = 0;
myColor = setLineColor(myPrevId, Qt::white, true);
}
-QColor PartSet_MenuMgr::setLineColor(int theId, const QColor theColor,
+QColor PartSet_MenuMgr::setLineColor(int /*theId*/, const QColor theColor,
bool theUpdate) {
- XGUI_ModuleConnector *aConnector =
- dynamic_cast<XGUI_ModuleConnector *>(myModule->workshop());
+ auto *aConnector = dynamic_cast<XGUI_ModuleConnector *>(myModule->workshop());
XGUI_Workshop *aWorkshop = aConnector->workshop();
XGUI_Displayer *aDisplayer = aWorkshop->displayer();
if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) {
std::shared_ptr<GeomAPI_Pnt2d> aPnt =
PartSet_Tools::getCoincedencePoint(aConstrFeature);
- if (aPnt.get() == NULL)
+ if (aPnt.get() == nullptr)
return;
if (theRefPnt->isEqual(aPnt) && (!theOutList.contains(aConstrFeature))) {
theOutList.append(aConstrFeature);
addRefCoincidentFeatures(aRefList, aOrig, aToDelFeatures);
}
if (aToDelFeatures.size() > 0) {
- XGUI_ModuleConnector *aConnector =
+ auto *aConnector =
dynamic_cast<XGUI_ModuleConnector *>(myModule->workshop());
XGUI_Workshop *aWorkshop = aConnector->workshop();
- ModuleBase_Operation *anOpAction = new ModuleBase_Operation(
+ auto *anOpAction = new ModuleBase_Operation(
tr("Detach %1").arg(QString::fromStdWString(aLine->data()->name())),
myModule);
XGUI_OperationMgr *anOpMgr = aConnector->workshop()->operationMgr();
// 1. change auxiliary type of a created feature
if (myModule->sketchMgr()->isNestedCreateOperation(anOperation, aSketch) &&
PartSet_SketcherMgr::isEntity(anOperation->id().toStdString())) {
- ModuleBase_OperationFeature *aFOperation =
+ auto *aFOperation =
dynamic_cast<ModuleBase_OperationFeature *>(anOperation);
if (aFOperation)
anObjects.append(aFOperation->feature());
QAction *anAction = action("AUXILIARY_CMD");
// SessionPtr aMgr = ModelAPI_Session::get();
- ModuleBase_Operation *anOpAction = 0;
- XGUI_ModuleConnector *aConnector =
- dynamic_cast<XGUI_ModuleConnector *>(myModule->workshop());
+ ModuleBase_Operation *anOpAction = nullptr;
+ auto *aConnector = dynamic_cast<XGUI_ModuleConnector *>(myModule->workshop());
XGUI_OperationMgr *anOpMgr = aConnector->workshop()->operationMgr();
if (isUseTransaction) {
anOpAction = new ModuleBase_Operation(anAction->text(), myModule);
aLast = anObjects.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
- if (aFeature.get() != NULL) {
+ if (aFeature.get() != nullptr) {
std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
- if (aSketchFeature.get() != NULL) {
+ if (aSketchFeature.get() != nullptr) {
std::string anAttribute = SketchPlugin_SketchEntity::AUXILIARY_ID();
std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr =
// 1. change auxiliary type of a created feature
if (myModule->sketchMgr()->isNestedCreateOperation(anOperation, aSketch) &&
PartSet_SketcherMgr::isEntity(anOperation->id().toStdString())) {
- ModuleBase_OperationFeature *aFOperation =
+ auto *aFOperation =
dynamic_cast<ModuleBase_OperationFeature *>(anOperation);
if (aFOperation)
anObjects.append(aFOperation->feature());
aLast = anObjects.end();
for (; anIt != aLast && !isNotAuxiliaryFound; anIt++) {
FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
- if ((aFeature.get() != NULL) &&
+ if ((aFeature.get() != nullptr) &&
PartSet_SketcherMgr::isEntity(aFeature->getKind())) {
anEnabled = true;
std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
- if (aSketchFeature.get() != NULL) {
+ if (aSketchFeature.get() != nullptr) {
std::string anAttribute = SketchPlugin_SketchEntity::AUXILIARY_ID();
std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr =
if (aFeature.get())
break;
}
- if (aFeature.get() == NULL) {
+ if (aFeature.get() == nullptr) {
ResultParameterPtr aParam;
foreach (ObjectPtr aObj, aObjects) {
aParam = std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aObj);
if (aParam.get())
break;
}
- if (aParam.get() != NULL)
+ if (aParam.get() != nullptr)
aFeature = ModelAPI_Feature::feature(aParam);
}
- if (aFeature.get() != NULL)
+ if (aFeature.get() != nullptr)
myModule->editFeature(aFeature);
}
/// Redefinition of virtual method
/// \param theObj an object
/// \param theEvent an event
- virtual bool eventFilter(QObject *theObj, QEvent *theEvent);
+ bool eventFilter(QObject *theObj, QEvent *theEvent) override;
private:
/// Returns true if the current operation is sketch entity create operation
mutable FeaturePtr mySelectedFeature;
/// Id of menu item in Detach menu previously selected
- int myPrevId;
+ int myPrevId{-1};
/// Original color of highlighted line
QColor myColor;
#include <Events_Listener.h>
-//#include <StdSelect_FaceFilter.hxx>
+// #include <StdSelect_FaceFilter.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_ListOfFilter.hxx>
#include <TopoDS_Shape.hxx>
/// Constructor
/// \param theWshop a pointer to a workshop
PartSet_Module(ModuleBase_IWorkshop *theWshop);
- virtual ~PartSet_Module();
+ ~PartSet_Module() override;
// Stores the current selection
- virtual void storeSelection();
+ void storeSelection() override;
// Restores the current selection
- virtual void restoreSelection();
+ void restoreSelection() override;
/// Creates custom widgets for property panel
- virtual ModuleBase_ModelWidget *
+ ModuleBase_ModelWidget *
createWidgetByType(const std::string &theType, QWidget *theParent,
- Config_WidgetAPI *theWidgetApi);
+ Config_WidgetAPI *theWidgetApi) override;
/// Returns the active widget, by default it is the property panel active
/// widget If the internal edit operation is started, this is the first widget
/// of the operation
- virtual ModuleBase_ModelWidget *activeWidget() const;
+ ModuleBase_ModelWidget *activeWidget() const override;
/// Call back forlast tuning of property panel before operation performance
- virtual void propertyPanelDefined(ModuleBase_Operation *theOperation);
+ void propertyPanelDefined(ModuleBase_Operation *theOperation) override;
/// If there is found selected attribute, widgets are created and contains
/// only a widget for the attribute
/// \param theXmlRepr an XML representation of the operation
/// \param theWidgets a list of created widgets
/// \return boolean result, false by default
- virtual bool createWidgets(const FeaturePtr &theFeature,
- const QString &theXmlRepr,
- QList<ModuleBase_ModelWidget *> &theWidgets) const;
+ bool
+ createWidgets(const FeaturePtr &theFeature, const QString &theXmlRepr,
+ QList<ModuleBase_ModelWidget *> &theWidgets) const override;
/// Launching of a edit operation on the feature
/// \param theFeature feature for editing
- virtual void editFeature(FeaturePtr theFeature);
+ void editFeature(FeaturePtr theFeature) override;
/// Returns true if the operation can be committed. Result in default
/// implementation is true. \return boolean value
- virtual bool canCommitOperation() const;
+ bool canCommitOperation() const override;
/// Creates an operation and send it to loop
/// \param theCmdId the operation name
/// \param isStartAfterCommitOnly operation is launched if there is no active
/// operation or
/// it is committed
- virtual void launchOperation(const QString &theCmdId,
- const bool &isStartAfterCommitOnly);
+ void launchOperation(const QString &theCmdId,
+ const bool &isStartAfterCommitOnly) override;
/// Realizes some functionality by an operation start
/// Displays all sketcher sub-Objects, hides sketcher result, appends
/// selection filters Activate the operation presentation \param theOperation
/// a started operation
- virtual void operationStarted(ModuleBase_Operation *theOperation);
+ void operationStarted(ModuleBase_Operation *theOperation) override;
/// Realizes some functionality by an operation resume
/// Activate the operation presentation
/// \param theOperation a resumed operation
- virtual void operationResumed(ModuleBase_Operation *theOperation);
+ void operationResumed(ModuleBase_Operation *theOperation) override;
/// Realizes some functionality by an operation commit
/// Restarts sketcher operation automatically of it is necessary
/// \param theOperation a committed operation
- virtual void operationCommitted(ModuleBase_Operation *theOperation);
+ void operationCommitted(ModuleBase_Operation *theOperation) override;
/// Realizes some functionality by an operation abort
/// Hides all sketcher sub-Objects, displays sketcher result and removes
/// selection filters \param theOperation an aborted operation
- virtual void operationAborted(ModuleBase_Operation *theOperation);
+ void operationAborted(ModuleBase_Operation *theOperation) override;
/// Realizes some functionality by an operation stop
/// Hides all sketcher sub-Objects, displays sketcher result and removes
/// selection filters \param theOperation a stopped operation
- virtual void operationStopped(ModuleBase_Operation *theOperation);
+ void operationStopped(ModuleBase_Operation *theOperation) override;
/// Returns current operation
- virtual ModuleBase_Operation *currentOperation() const;
+ ModuleBase_Operation *currentOperation() const override;
/// Returns True if there are available Undos and the sketch manager allows
/// undo \return the boolean result
- virtual bool canUndo() const;
+ bool canUndo() const override;
//! Returns True if there are available Redos and the sketch manager allows
//! redo
/// \return the boolean result
- virtual bool canRedo() const;
+ bool canRedo() const override;
/// Returnas true if the action can be applyed to the object
/// \param theObject a checked object
/// \param theActionId an identifier of action, to be found in the menu
/// manager like "DELETE_CMD" \return the a booean result
- virtual bool canApplyAction(const ObjectPtr &theObject,
- const QString &theActionId) const;
+ bool canApplyAction(const ObjectPtr &theObject,
+ const QString &theActionId) const override;
/// Returns True if the current operation can be committed. Asks the sketch
/// manager. \return a boolean value
/// Returns whether the object can be erased at the bounds of the active
/// operation. The sub-objects of the current operation can not be erased
/// \param theObject a model object
- virtual bool canEraseObject(const ObjectPtr &theObject) const;
+ bool canEraseObject(const ObjectPtr &theObject) const override;
/// Returns whether the object can be displayed at the bounds of the active
/// operation. Display only current operation results for usual operation and
/// ask the sketcher manager if it is a sketch operation \param theObject a
/// model object
- virtual bool canDisplayObject(const ObjectPtr &theObject) const;
+ bool canDisplayObject(const ObjectPtr &theObject) const override;
/// Returns parent result if accepted, true if the started operation is a
/// nested operation of the previous operation \param thePreviousOperationKind
/// a kind of previous operation \param theStartedOperationKind a kind of a
/// new operation
- virtual bool canUsePreselection(const QString &thePreviousOperationKind,
- const QString &theStartedOperationKind);
+ bool canUsePreselection(const QString &thePreviousOperationKind,
+ const QString &theStartedOperationKind) override;
/// Make some functionality after the objects are hidden in viewer
/// \param theObjects a list of hidden objects
/// For sketch operation allow the selection activation if the operation is
/// edit, for other operation uses the default result \param theObject a model
/// object
- virtual bool canActivateSelection(const ObjectPtr &theObject) const;
+ bool canActivateSelection(const ObjectPtr &theObject) const override;
/// Add menu atems for object browser into the given menu
/// \param theMenu a popup menu to be shown in the object browser
- virtual void addObjectBrowserMenu(QMenu *theMenu) const;
+ void addObjectBrowserMenu(QMenu *theMenu) const override;
/// Add menu items for viewer into the actions map
/// \param theStdActions a map of standard actions
/// \param theMenuActions map of action/menu for the desirable index in the
/// viewer menu \return true if items are added and there is no necessity to
/// provide standard menu
- virtual bool addViewerMenu(const QMap<QString, QAction *> &theStdActions,
- QWidget *theParent,
- QMap<int, QAction *> &theMenuActions) const;
+ bool addViewerMenu(const QMap<QString, QAction *> &theStdActions,
+ QWidget *theParent,
+ QMap<int, QAction *> &theMenuActions) const override;
/// Returns a list of modes, where the AIS objects should be activated
/// \param theModes a list of modes
- virtual void activeSelectionModes(QIntList &theModes);
+ void activeSelectionModes(QIntList &theModes) override;
/// Appends specific selection modes for the module to the list of types
/// \param theModesType combination of available selection filters
/// \param theModes a selection modes to be extended
- virtual void moduleSelectionModes(int theModesType, QIntList &theModes);
+ void moduleSelectionModes(int theModesType, QIntList &theModes) override;
/// Appends into container of filters module filters corresponded to the modes
/// type \param theFilterTypes container of available selection filters \param
/// theSelectionFilters [out] container to be extend by elements
- virtual void
+ void
moduleSelectionFilters(const QIntList &theFilterTypes,
- SelectMgr_ListOfFilter &theSelectionFilters);
+ SelectMgr_ListOfFilter &theSelectionFilters) override;
/// Returns whether the mouse enter the viewer's window
/// \return true if items are added and there is no necessity to provide
bool isSketchNeutralPointActivated() const;
/// Performs functionality on closing document
- virtual void closeDocument();
+ void closeDocument() override;
/// Clears specific presentations in the viewer
- virtual void clearViewer();
+ void clearViewer() override;
/// Event Listener method
/// \param theMessage an event message
- virtual void processEvent(const std::shared_ptr<Events_Message> &theMessage);
+ void processEvent(const std::shared_ptr<Events_Message> &theMessage) override;
/// Set the object with the object results are customized
/// \param theFeature a feature
/// Return true if the custom presentation is activated
/// \param theFlag a flag of level of customization, which means that only
/// part of sub-elements \return boolean value
- virtual bool
- isCustomPrsActivated(const ModuleBase_CustomizeFlag &theFlag) const;
+ bool
+ isCustomPrsActivated(const ModuleBase_CustomizeFlag &theFlag) const override;
/// Activate custom presentation for the object
/// \param theFeature a feature instance
/// \param theFlag a flag of level of customization, which means that only
/// part of sub-elements \param theUpdateViewer the parameter whether the
/// viewer should be update immediately
- virtual void activateCustomPrs(const FeaturePtr &theFeature,
- const ModuleBase_CustomizeFlag &theFlag,
- const bool theUpdateViewer);
+ void activateCustomPrs(const FeaturePtr &theFeature,
+ const ModuleBase_CustomizeFlag &theFlag,
+ const bool theUpdateViewer) override;
/// Deactivate custom presentation for the object
/// \param theFlag a flag of level of customization, which means that only
/// part of sub-elements \param theUpdateViewer the parameter whether the
/// viewer should be update immediately
- virtual void deactivateCustomPrs(const ModuleBase_CustomizeFlag &theFlag,
- const bool theUpdateViewer);
+ void deactivateCustomPrs(const ModuleBase_CustomizeFlag &theFlag,
+ const bool theUpdateViewer) override;
/// Modifies the given presentation in the custom way.
// virtual bool customisePresentation(std::shared_ptr<ModelAPI_Result>
/// be updated(e.g. only highlighted elements) \param theUpdateViewer the
/// parameter whether the viewer should be update immediatelly \returns true
/// if the object is modified
- virtual bool customizeFeature(ObjectPtr theObject,
- const ModuleBase_CustomizeFlag &theFlag,
- const bool theUpdateViewer);
+ bool customizeFeature(ObjectPtr theObject,
+ const ModuleBase_CustomizeFlag &theFlag,
+ const bool theUpdateViewer) override;
/// Disable displaying of custom mode
/// \param theMode a mode to disable
- virtual void disableCustomMode(ModuleBase_CustomizeFlag theMode);
+ void disableCustomMode(ModuleBase_CustomizeFlag theMode) override;
/// Enables disabled custom mode
- virtual void enableCustomModes();
+ void enableCustomModes() override;
/// This method is called on object browser creation for customisation of
/// module specific features \param theObjectBrowser a pinter on Object
/// Browser widget
- virtual void customizeObjectBrowser(QWidget *theObjectBrowser);
+ void customizeObjectBrowser(QWidget *theObjectBrowser) override;
/// Returns the viewer Z layer
int getVisualLayerId() const { return myVisualLayerId; }
/// Create specific for the module presentation
/// \param theResult an object for presentation
/// \return created presentation or NULL(default value)
- virtual AISObjectPtr createPresentation(const ObjectPtr &theResult);
+ AISObjectPtr createPresentation(const ObjectPtr &theResult) override;
/// Customize presentation according to objects attributes
/// \param theObject an object for presentation
/// \param thePrs a presentation object
- virtual void customizePresentation(const ObjectPtr &theObject,
- const AISObjectPtr &thePrs) const;
+ void customizePresentation(const ObjectPtr &theObject,
+ const AISObjectPtr &thePrs) const override;
//! Returns data object by AIS
- virtual ObjectPtr findPresentedObject(const AISObjectPtr &theAIS) const;
+ ObjectPtr findPresentedObject(const AISObjectPtr &theAIS) const override;
//! Returns true if the presentation can be shown in shading mode
//! \param theAIS presentation to be checked
//! \return boolean value
- virtual bool canBeShaded(Handle(AIS_InteractiveObject) theAIS) const;
+ bool canBeShaded(Handle(AIS_InteractiveObject) theAIS) const override;
/// Update state of pop-up menu items in viewer
/// \param theStdActions - a map of standard actions
- virtual void updateViewerMenu(const QMap<QString, QAction *> &theStdActions);
+ void updateViewerMenu(const QMap<QString, QAction *> &theStdActions) override;
/// Returns true if the action should be always enabled
/// \param theActionId an action index: Accept or Accept All
/// \return boolean value
- virtual bool isActionEnableStateFixed(const int theActionId) const;
+ bool isActionEnableStateFixed(const int theActionId) const override;
//! Returns the feature error if the current state of the feature in the
//! module is not correct If the feature is correct, it returns an empty value
//! \return string value
- virtual QString getFeatureError(const FeaturePtr &theFeature);
+ QString getFeatureError(const FeaturePtr &theFeature) override;
/// Returns list of granted operation indices
- virtual void grantedOperationIds(ModuleBase_Operation *theOperation,
- QStringList &theIds) const;
+ void grantedOperationIds(ModuleBase_Operation *theOperation,
+ QStringList &theIds) const override;
/// Validates the current operation and send the state change to sketch
/// manager \param thePreviousState the previous widget value state
- virtual void widgetStateChanged(int thePreviousState);
+ void widgetStateChanged(int thePreviousState) override;
/// Returns true if the event is processed. It gives the reentrance manager to
/// process the enter. \param thePreviousAttributeID an index of the previous
/// active attribute
- virtual bool processEnter(const std::string &thePreviousAttributeID);
+ bool processEnter(const std::string &thePreviousAttributeID) override;
/// Performs some GUI actions before an operation transaction is stopped
/// Default realization is empty
- virtual void beforeOperationStopped(ModuleBase_Operation *theOperation);
+ void beforeOperationStopped(ModuleBase_Operation *theOperation) override;
/// Finds a shape by attribute if it is possible
/// \param theAttribute an attribute
/// \return a geom shape
- virtual GeomShapePtr findShape(const AttributePtr &theAttribute);
+ GeomShapePtr findShape(const AttributePtr &theAttribute) override;
/// Finds an attribute by geom shape if it is possible
/// \param theObject an object of the attribute
/// \param theGeomShape a geom shape
/// \return theAttribute
- virtual AttributePtr findAttribute(const ObjectPtr &theObject,
- const GeomShapePtr &theGeomShape);
+ AttributePtr findAttribute(const ObjectPtr &theObject,
+ const GeomShapePtr &theGeomShape) override;
/// Returns reentrant message if it was accepted
- virtual std::shared_ptr<Events_Message> reentrantMessage();
+ std::shared_ptr<Events_Message> reentrantMessage() override;
/// Put current selection into reentrant message
/// \param theMessage a message of reentrant operation
- virtual void
- setReentrantPreSelection(const std::shared_ptr<Events_Message> &theMessage);
+ void setReentrantPreSelection(
+ const std::shared_ptr<Events_Message> &theMessage) override;
/// Returns root tree node which represents a data model
- virtual ModuleBase_ITreeNode *rootNode() const;
+ ModuleBase_ITreeNode *rootNode() const override;
/// Returns the workshop
XGUI_Workshop *getWorkshop() const;
/// Reads description of features from XML file
- virtual void createFeatures();
+ void createFeatures() override;
/// add texture
static void setTexture(const AISObjectPtr &thePrs,
/// Slolt called on object display
/// \param theObject a data object
/// \param theAIS a presentation object
- virtual void onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS);
+ void onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS) override;
/// Slot called on before object erase
/// \param theObject a data object
/// \param theAIS a presentation object
- virtual void onBeforeObjectErase(ObjectPtr theObject, AISObjectPtr theAIS);
+ void onBeforeObjectErase(ObjectPtr theObject, AISObjectPtr theAIS) override;
/// Called on transformation in current viewer
/// \param theTrsfType type of tranformation
- virtual void onViewTransformed(int theTrsfType = 2);
+ void onViewTransformed(int theTrsfType = 2) override;
/// Called on remove conflicting constraints
void onRemoveConflictingConstraints();
protected slots:
/// Called when previous operation is finished
- virtual void onSelectionChanged();
+ void onSelectionChanged() override;
/// SLOT, that is called by key release in the viewer.
/// \param theWnd a view window
void updateConstraintsState(const std::string &theFeatureKind);
/// Register validators for this module
- virtual void registerValidators();
+ void registerValidators() override;
/// Connects or disconnects to the value changed signal of the property panel
/// widgets \param theWidget a property contol widget \param isToConnect a
/// boolean value whether connect or disconnect
- virtual void connectToPropertyPanel(ModuleBase_ModelWidget *theWidget,
- const bool isToConnect);
+ void connectToPropertyPanel(ModuleBase_ModelWidget *theWidget,
+ const bool isToConnect) override;
/// Updates reentrant manager state or sketcher operations for the started
/// operation \param theOperation the started operation
private:
//! Delete features
- virtual bool deleteObjects();
+ bool deleteObjects() override;
void setDefaultConstraintShown();
#include <TopoDS_Vertex.hxx>
#include <gp_Pnt.hxx>
-//#define DEBUG_EMPTY_SHAPE
-//#define DEBUG_OPERATION_PRS
+// #define DEBUG_EMPTY_SHAPE
+// #define DEBUG_OPERATION_PRS
// multi-rotation/translation operation
-//#define DEBUG_HIDE_COPY_ATTRIBUTE
+// #define DEBUG_HIDE_COPY_ATTRIBUTE
#ifdef DEBUG_HIDE_COPY_ATTRIBUTE
#include <ModelAPI_AttributeBoolean.h>
#include <SketchPlugin_SketchEntity.h>
protected:
/// Redefinition of virtual function
- Standard_EXPORT virtual void
+ Standard_EXPORT void
Compute(const Handle(PrsMgr_PresentationManager3d) & thePresentationManager,
const Handle(Prs3d_Presentation) & thePresentation,
- const Standard_Integer theMode = 0);
+ const Standard_Integer theMode = 0) override;
/// Redefinition of virtual function
- Standard_EXPORT virtual void
- ComputeSelection(const Handle(SelectMgr_Selection) & aSelection,
- const Standard_Integer aMode);
+ Standard_EXPORT void ComputeSelection(const Handle(SelectMgr_Selection) &
+ aSelection,
+ const Standard_Integer aMode) override;
protected:
/// list of visualized shapes
#include <QString>
#include <QTimer>
-//#define DEBUG_FEATURE_OVERCONSTRAINT_LISTENER
+// #define DEBUG_FEATURE_OVERCONSTRAINT_LISTENER
PartSet_OverconstraintListener::PartSet_OverconstraintListener(
ModuleBase_IWorkshop *theWorkshop)
/// displayer
PartSet_OverconstraintListener(ModuleBase_IWorkshop *theWorkshop);
- virtual ~PartSet_OverconstraintListener(){};
+ ~PartSet_OverconstraintListener() override = default;
+ ;
/// If active state is changed, update fully defined state and sketch
/// sub-entities color \param theActive a state
void getCustomColor(const ObjectPtr &theObject, std::vector<int> &theColor);
/// Redefinition of Events_Listener method
- virtual void processEvent(const std::shared_ptr<Events_Message> &theMessage);
+ void processEvent(const std::shared_ptr<Events_Message> &theMessage) override;
bool isConflictingObject(const ObjectPtr &theObject) const {
return (myConflictingObjects.find(theObject) != myConflictingObjects.end());
/// Constructor
PartSet_PreviewSketchPlane();
- ~PartSet_PreviewSketchPlane(){};
+ ~PartSet_PreviewSketchPlane() = default;
+ ;
/// Erase preview planes
/// \param theWorkshop the application workshop
#include <StdSelect_BRepSelectionTool.hxx>
#include <TopoDS_Builder.hxx>
-//#define DEBUG_WIRE
+// #define DEBUG_WIRE
#ifdef DEBUG_WIRE
#include <TopExp.hxx>
#include <set>
-//#define DEBUG_DO_NOT_BY_ENTER
-//#define DEBUG_SKETCHER_ENTITIES
-//#define DEBUG_SKETCH_ENTITIES_ON_MOVE
-//#define DRAGGING_DEBUG
-//#define DEBUG_CURSOR
+// #define DEBUG_DO_NOT_BY_ENTER
+// #define DEBUG_SKETCHER_ENTITIES
+// #define DEBUG_SKETCH_ENTITIES_ON_MOVE
+// #define DRAGGING_DEBUG
+// #define DEBUG_CURSOR
#ifdef DRAGGING_DEBUG
#include <QTime>
QCursor *aCurrentCursor = QApplication::overrideCursor();
if (!aCurrentCursor || aCurrentCursor->shape() != Qt::CrossCursor) {
QApplication::setOverrideCursor(PartSet_Tools::getOperationCursor());
- //#ifdef DEBUG_CURSOR
- // qDebug("onEnterViewPort() : Qt::CrossCursor");
- //#endif
+ // #ifdef DEBUG_CURSOR
+ // qDebug("onEnterViewPort() : Qt::CrossCursor");
+ // #endif
}
}
if (canChangeCursor(getCurrentOperation())) {
QApplication::restoreOverrideCursor();
- //#ifdef DEBUG_CURSOR
- // qDebug("onLeaveViewPort() : None");
- //#endif
+ // #ifdef DEBUG_CURSOR
+ // qDebug("onLeaveViewPort() : None");
+ // #endif
}
if (!isNestedCreateOperation(getCurrentOperation(), activeSketch()))
QCursor *aCurrentCursor = QApplication::overrideCursor();
if (!aCurrentCursor || aCurrentCursor->shape() != Qt::CrossCursor) {
QApplication::setOverrideCursor(PartSet_Tools::getOperationCursor());
- //#ifdef DEBUG_CURSOR
- // qDebug("startNestedSketch() : Qt::CrossCursor");
- //#endif
+ // #ifdef DEBUG_CURSOR
+ // qDebug("startNestedSketch() : Qt::CrossCursor");
+ // #endif
}
}
}
PartSet_Fitter(PartSet_SketcherMgr *theSketchMgr)
: mySketchMgr(theSketchMgr) {}
- virtual ~PartSet_Fitter() {}
+ virtual ~PartSet_Fitter() = default;
/// A method which has top be reimplemented to provide alterantive
/// implementation FitAll command \param theView - a view which has to be fit
- virtual void fitAll(Handle(V3d_View) theView);
+ void fitAll(Handle(V3d_View) theView) override;
private:
PartSet_SketcherMgr *mySketchMgr;
/// Constructor
Point() { myIsInitialized = false; }
/// Destructor
- ~Point() {}
+ ~Point() = default;
/// clear the initialized flag.
void clear() { myIsInitialized = false; }
TopoDS_Shape myFirstResultShape; /// the first shape of feature result
TopTools_MapOfShape myLocalSelectedShapes; /// shapes of local selection
};
- typedef QMap<FeaturePtr, SelectionInfo> FeatureToSelectionMap;
+ using FeatureToSelectionMap = QMap<FeaturePtr, SelectionInfo>;
public:
/// Constructor
/// \param theModule a pointer to PartSet module
PartSet_SketcherMgr(PartSet_Module *theModule);
- virtual ~PartSet_SketcherMgr();
+ ~PartSet_SketcherMgr() override;
/// Returns true if the operation is the sketch
/// \param theOperation an operation
/** \brief Implementation of Event Listener method
* \param[in] theMessage the data of the event
*/
- virtual void processEvent(const std::shared_ptr<Events_Message> &theMessage);
+ void processEvent(const std::shared_ptr<Events_Message> &theMessage) override;
/// Returns true if current mode of objects creation is by drag mouse
bool isDragModeCreation() const;
#include <QToolButton>
-//#define DEBUG_RESTART
+// #define DEBUG_RESTART
PartSet_SketcherReentrantMgr::PartSet_SketcherReentrantMgr(
ModuleBase_IWorkshop *theWorkshop)
#include <QDoubleValidator>
#include <QLabel>
#include <QLineEdit>
-//#include <QFormLayout>
+// #include <QFormLayout>
#include <QMainWindow>
#include <QMessageBox>
#include <QVBoxLayout>
return MY_PART_KIND;
}
/// Returns the kind of a feature
- PARTSETPLUGIN_EXPORT virtual const std::string &getKind() {
+ PARTSETPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = PartSetPlugin_Part::ID();
return MY_KIND;
}
// LCOV_EXCL_STOP
/// Creates a new part document if needed
- PARTSETPLUGIN_EXPORT virtual void execute();
+ PARTSETPLUGIN_EXPORT void execute() override;
/// Request for initialization of data model of the feature: adding all
/// attributes
- PARTSETPLUGIN_EXPORT virtual void initAttributes();
+ PARTSETPLUGIN_EXPORT void initAttributes() override;
/// Part must be added only to PartSet
- PARTSETPLUGIN_EXPORT virtual const std::string &documentToAdd();
+ PARTSETPLUGIN_EXPORT const std::string &documentToAdd() override;
// composite feature methods
/// Adds feature to its document
- virtual std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID);
+ std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID) override;
/// Returns the number of sub-features of the document
- virtual int numberOfSubs(bool forTree = false) const;
+ int numberOfSubs(bool forTree = false) const override;
/// Returns the sub-feature by zero-base index
- virtual std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex,
- bool forTree = false);
+ std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex,
+ bool forTree = false) override;
/// Returns the sub-feature unique identifier in this composite feature by
/// zero-base index
- virtual int subFeatureId(const int theIndex) const;
+ int subFeatureId(const int theIndex) const override;
/// Returns true if feature or reuslt belong to this composite feature as subs
- virtual bool isSub(ObjectPtr theObject) const;
+ bool isSub(ObjectPtr theObject) const override;
/// This method to inform that sub-feature is removed and must be removed from
/// the internal data structures of the owner (the remove from the document
/// will be done outside just after)
- virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature) {}
+ void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature) override {}
/// Use plugin manager for features creation
PartSetPlugin_Part();
/// Just removes all features of the part without touching the document data
/// (to be able undo)
- PARTSETPLUGIN_EXPORT virtual void erase();
+ PARTSETPLUGIN_EXPORT void erase() override;
};
#endif
#include <sstream>
//=================================================================================================
-PrimitivesPlugin_Sphere::PrimitivesPlugin_Sphere() {}
+PrimitivesPlugin_Sphere::PrimitivesPlugin_Sphere() = default;
//=================================================================================================
void PrimitivesPlugin_Sphere::initAttributes() {
std::shared_ptr<GeomAPI_Pnt> aCenterPoint;
std::shared_ptr<ModelAPI_AttributeSelection> aPointRef =
selection(PrimitivesPlugin_Sphere::CENTER_POINT_ID());
- if (aPointRef.get() != NULL) {
+ if (aPointRef.get() != nullptr) {
GeomShapePtr aShape1 = aPointRef->value();
if (!aShape1.get()) {
aShape1 = aPointRef->context()->shape();
// Naming for faces and edges
std::map<std::string, std::shared_ptr<GeomAPI_Shape>> listOfFaces =
theSphereAlgo->getCreatedFaces();
- for (std::map<std::string, std::shared_ptr<GeomAPI_Shape>>::iterator it =
- listOfFaces.begin();
- it != listOfFaces.end(); ++it) {
- theResultSphere->generated((*it).second, (*it).first);
+ for (auto &listOfFace : listOfFaces) {
+ theResultSphere->generated(listOfFace.second, listOfFace.first);
}
// Naming vertices
}
/// Returns the kind of a feature
- PRIMITIVESPLUGIN_EXPORT virtual const std::string &getKind() {
+ PRIMITIVESPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = PrimitivesPlugin_Sphere::ID();
return MY_KIND;
}
/// Creates a new part document if needed
- PRIMITIVESPLUGIN_EXPORT virtual void execute();
+ PRIMITIVESPLUGIN_EXPORT void execute() override;
/// Request for initialization of data model of the feature: adding all
/// attributes
- PRIMITIVESPLUGIN_EXPORT virtual void initAttributes();
+ PRIMITIVESPLUGIN_EXPORT void initAttributes() override;
/// Use plugin manager for features creation
PrimitivesPlugin_Sphere();
# START DEBUG PURPOSES
# Should be removed
-import ModelAPI
# END DEBUG PURPOSES
"""
import salome
-import SALOME_ModuleCatalog
import ConfigAPI
# needed on immediate start of SHAPER from SALOME: salome.naming_service is not initialized then
import ModelHighAPI
-import ModelAPI
import SketchAPI
import sys
.lstrip(".")
.lstrip("0")
)
- assert math.fabs(
- aResultVolume - anExpectedResultVolume
- ) <= aTolerance * math.fabs(
- anExpectedResultVolume
+ assert (
+ math.fabs(aResultVolume - anExpectedResultVolume)
+ <= aTolerance * math.fabs(anExpectedResultVolume)
), "Volume of result[{}]: {:0.27f}. Expected: {:0.27f}. The first {} significant digits not equal.".format(
anIndex, aResultVolume, anExpectedResultVolume, theNbSignificantDigits
)
.lstrip(".")
.lstrip("0")
)
- assert math.fabs(
- aResultVolume - anExpectedResultVolume
- ) <= aTolerance * math.fabs(
- anExpectedResultVolume
+ assert (
+ math.fabs(aResultVolume - anExpectedResultVolume)
+ <= aTolerance * math.fabs(anExpectedResultVolume)
), "Area of result[{}]: {:0.27f}. Expected: {:0.27f}. The first {} significant digits not equal.".format(
anIndex, aResultVolume, anExpectedResultVolume, theNbSignificantDigits
)
"""
from salome.shaper import model
-from salome.shaper import geom
import ModelAPI
"""
from salome.shaper import model
-from salome.shaper import geom
import ModelAPI
import ParametersAPI
salome.salome_init()
-import SALOMEDS
from SketchAPI import *
from salome.shaper import model
from salome.shaper import geom
if len(splitLine) != 2:
print(line)
diagno = 1
- elif not splitLine[0] in self.infoPoints:
+ elif splitLine[0] not in self.infoPoints:
print(line)
diagno = 2
elif splitLine[1] == "angular_connection":
SHAPERGUI_NestedButton::SHAPERGUI_NestedButton(
QObject *theParent, const QList<QAction *> &theNestedActions)
- : QWidgetAction(theParent), myNestedActions(theNestedActions),
- myAdditionalButtonsWidget(0), myButtonFrame(0), myThisButton(0) {}
+ : QWidgetAction(theParent), myNestedActions(theNestedActions) {}
-SHAPERGUI_NestedButton::~SHAPERGUI_NestedButton() {}
+SHAPERGUI_NestedButton::~SHAPERGUI_NestedButton() = default;
void SHAPERGUI_NestedButton::showAdditionalButtons(bool isShow) {
myAdditionalButtonsWidget->setVisible(isShow);
QWidget *SHAPERGUI_NestedButton::createWidget(QWidget *theParent) {
// the action has widget only in tool bar, in menu bar, the default
// action presentation is shown
- QToolBar *aToolBar = dynamic_cast<QToolBar *>(theParent);
+ auto *aToolBar = dynamic_cast<QToolBar *>(theParent);
if (!aToolBar)
- return 0;
+ return nullptr;
myButtonFrame = new QFrame(theParent);
- QHBoxLayout *aBoxLay = new QHBoxLayout(myButtonFrame);
+ auto *aBoxLay = new QHBoxLayout(myButtonFrame);
aBoxLay->setContentsMargins(2, 0, 0, 0);
aBoxLay->setSpacing(1);
QSizePolicy aSizePolicy;
aBoxLay->addWidget(myThisButton, 1);
myAdditionalButtonsWidget = new QWidget(myButtonFrame);
- QHBoxLayout *aAdditionalBoxLay = new QHBoxLayout(myAdditionalButtonsWidget);
+ auto *aAdditionalBoxLay = new QHBoxLayout(myAdditionalButtonsWidget);
aAdditionalBoxLay->setContentsMargins(0, 0, 0, 0);
aAdditionalBoxLay->setSpacing(1);
foreach (QAction *eachAct, myNestedActions) {
- QToolButton *aButton = new QToolButton(myButtonFrame);
+ auto *aButton = new QToolButton(myButtonFrame);
aButton->setDefaultAction(eachAct);
aButton->setAutoRaise(true);
aAdditionalBoxLay->addWidget(aButton);
/// \param theNestedActions a list of nested actions
SHAPERGUI_NestedButton(QObject *theParent,
const QList<QAction *> &theNestedActions);
- virtual ~SHAPERGUI_NestedButton();
+ ~SHAPERGUI_NestedButton() override;
private slots:
/// Shows/hides the additional buttons widget
protected:
/// Creates the button representation
/// \param theParent a parent widget
- virtual QWidget *createWidget(QWidget *theParent);
+ QWidget *createWidget(QWidget *theParent) override;
- virtual bool event(QEvent *theEvent);
+ bool event(QEvent *theEvent) override;
private:
- QList<QAction *> myNestedActions; ///< list of nested actions
- QWidget *myAdditionalButtonsWidget; ///< widget to precess additional buttons
- ///< visibility
- QFrame *myButtonFrame; ///< frame arround button representation
- QToolButton *myThisButton; ///< main button
+ QList<QAction *> myNestedActions; ///< list of nested actions
+ QWidget *myAdditionalButtonsWidget{0}; ///< widget to precess additional
+ ///< buttons visibility
+ QFrame *myButtonFrame{0}; ///< frame arround button representation
+ QToolButton *myThisButton{0}; ///< main button
};
#endif /* SRC_SHAPERGUI_NESTEDBUTTON_H_ */
#include <ModelAPI_Plugin.h>
#include <SamplePanelPlugin.h>
-//#include <ModuleBase_IWidgetCreator.h>
+// #include <ModuleBase_IWidgetCreator.h>
#include <ModelAPI_Events.h>
#include <ModelAPI_Feature.h>
/// Initializes the algorithm
SELECTOR_EXPORT Selector_Algo();
- virtual ~Selector_Algo() {}
+ virtual ~Selector_Algo() = default;
/// Initializes the selector structure on the label.
/// Stores the name data to restore after modification.
class Selector_NameGenerator {
public:
/// empty constructor, nothing to add
- Selector_NameGenerator(){};
+ Selector_NameGenerator() = default;
+ ;
/// This method returns the context name by the label of the sub-selected
/// shape
SELECTOR_EXPORT void select(const TDF_Label theFinalLabel);
/// Stores the name to the label and sub-labels tree
- SELECTOR_EXPORT virtual void store() override;
+ SELECTOR_EXPORT void store() override;
/// Restores the selected shape by the topological naming kept in the data
/// structure Returns true if it can restore structure correctly
- SELECTOR_EXPORT virtual bool restore() override;
+ SELECTOR_EXPORT bool restore() override;
/// Restores the selected shape by the topological name string.
/// Returns not empty label of the context.
- SELECTOR_EXPORT virtual TDF_Label
+ SELECTOR_EXPORT TDF_Label
restoreByName(std::wstring theName, const TopAbs_ShapeEnum theShapeType,
Selector_NameGenerator *theNameGenerator) override;
/// Updates the current shape by the stored topological name
- SELECTOR_EXPORT virtual bool solve(const TopoDS_Shape &theContext) override;
+ SELECTOR_EXPORT bool solve(const TopoDS_Shape &theContext) override;
/// Returns the naming name of the selection
- SELECTOR_EXPORT virtual std::wstring
+ SELECTOR_EXPORT std::wstring
name(Selector_NameGenerator *theNameGenerator) override;
private:
}
//================================================================================================
-SketchAPI_MacroArc::~SketchAPI_MacroArc() {}
+SketchAPI_MacroArc::~SketchAPI_MacroArc() = default;
//================================================================================================
void SketchAPI_MacroArc::setByCenterStartEnd(double theCenterX,
/// Destructor.
SKETCHAPI_EXPORT
- virtual ~SketchAPI_MacroArc();
+ ~SketchAPI_MacroArc() override;
INTERFACE_14(
SketchPlugin_MacroArc::ID(), arcType, SketchPlugin_MacroArc::ARC_TYPE(),
};
/// Pointer on Arc object.
-typedef std::shared_ptr<SketchAPI_MacroArc> MacroArcPtr;
+using MacroArcPtr = std::shared_ptr<SketchAPI_MacroArc>;
#endif // SketchAPI_MacroArc_H_
// Find sketch
CompositeFeaturePtr aSketch;
const std::set<AttributePtr> &aRefs = feature()->data()->refsToMe();
- for (std::set<AttributePtr>::const_iterator anIt = aRefs.begin();
- anIt != aRefs.end(); ++anIt)
- if ((*anIt)->id() == SketchPlugin_Sketch::FEATURES_ID()) {
- aSketch = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(
- (*anIt)->owner());
+ for (const auto &aRef : aRefs)
+ if (aRef->id() == SketchPlugin_Sketch::FEATURES_ID()) {
+ aSketch =
+ std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aRef->owner());
break;
}
if (!aSketch)
static const std::string MY_SKETCH_CONSTRAINT_ID = "MacroConstraintMiddle";
return MY_SKETCH_CONSTRAINT_ID;
}
- virtual std::string getID() { return ID(); }
+ std::string getID() override { return ID(); }
protected:
void createConstraint(const ModelHighAPI_RefAttr &theLine);
const std::wstring &theExternalName);
/// Destructor
SKETCHAPI_EXPORT
- virtual ~SketchAPI_Point();
+ ~SketchAPI_Point() override;
INTERFACE_2(SketchPlugin_Point::ID(), coordinates,
SketchPlugin_Point::COORD_ID(), GeomDataAPI_Point2D,
/// Dump wrapped feature
SKETCHAPI_EXPORT
- virtual void dump(ModelHighAPI_Dumper &theDumper) const;
+ void dump(ModelHighAPI_Dumper &theDumper) const override;
};
//! Pointer on Point object
-typedef std::shared_ptr<SketchAPI_Point> PointPtr;
+using PointPtr = std::shared_ptr<SketchAPI_Point>;
//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
const std::shared_ptr<ModelAPI_Feature> &theFeature);
/// Destructor
SKETCHAPI_EXPORT
- virtual ~SketchAPI_SketchEntity();
+ ~SketchAPI_SketchEntity() override;
/// Auxiliary
SKETCHAPI_EXPORT
void setAuxiliary(bool theAuxiliary);
/// Dump wrapped feature
- virtual void dump(ModelHighAPI_Dumper &theDumper) const;
+ void dump(ModelHighAPI_Dumper &theDumper) const override;
/// Convert list of features to list of appropriate wrappers
SKETCHAPI_EXPORT
};
//! Pointer on SketchEntity object
-typedef std::shared_ptr<SketchAPI_SketchEntity> SketchEntityPtr;
+using SketchEntityPtr = std::shared_ptr<SketchAPI_SketchEntity>;
//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
}
/// Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_Arc::ID();
return MY_KIND;
}
/// Returns true is sketch element is under the rigid constraint
- SKETCHPLUGIN_EXPORT virtual bool isFixed();
+ SKETCHPLUGIN_EXPORT bool isFixed() override;
/// Called on change of any argument-attribute of this object
/// \param theID identifier of changed attribute
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Creates an arc-shape
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// Updates the "reversed" flag
/// \param isReversed whether the arc will be reversed
protected:
/// \brief Initializes attributes of derived class.
- virtual void initDerivedClassAttributes();
+ void initDerivedClassAttributes() override;
private:
/// to define in which direction draw arc
}
/// Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_BSpline::ID();
return MY_KIND;
}
/// Called on change of any argument-attribute of this object
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Use plugin manager for features creation
SketchPlugin_BSpline();
protected:
/// \brief Initializes attributes of derived class.
- virtual void initDerivedClassAttributes();
+ void initDerivedClassAttributes() override;
- virtual bool isPeriodic() const { return false; }
+ bool isPeriodic() const override { return false; }
};
#endif
}
/// Returns true is sketch element is under the rigid constraint
- SKETCHPLUGIN_EXPORT virtual bool isFixed();
+ SKETCHPLUGIN_EXPORT bool isFixed() override;
/// Called on change of any argument-attribute of this object
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// Updates the B-spline curve.
/// \param[in] theActionId action key id (in following form: Action#Index)
/// \return \c false in case the action not performed.
- SKETCHPLUGIN_EXPORT virtual bool customAction(const std::string &theActionId);
+ SKETCHPLUGIN_EXPORT bool
+ customAction(const std::string &theActionId) override;
protected:
/// Called from the derived class
SketchPlugin_BSplineBase();
/// \brief Initializes attributes of derived class.
- virtual void initDerivedClassAttributes();
+ void initDerivedClassAttributes() override;
/// \brief Return \c true if the B-spline curve is periodic
virtual bool isPeriodic() const = 0;
}
/// Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_BSplinePeriodic::ID();
return MY_KIND;
}
SketchPlugin_BSplinePeriodic();
protected:
- virtual bool isPeriodic() const { return true; }
+ bool isPeriodic() const override { return true; }
};
#endif
}
/// Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_Circle::ID();
return MY_KIND;
}
/// Returns true is sketch element is under the rigid constraint
- SKETCHPLUGIN_EXPORT virtual bool isFixed();
+ SKETCHPLUGIN_EXPORT bool isFixed() override;
/// Called on change of any argument-attribute of this object
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// Use plugin manager for features creation
SketchPlugin_Circle();
protected:
/// \brief Initializes attributes of derived class.
- virtual void initDerivedClassAttributes();
+ void initDerivedClassAttributes() override;
};
#endif
SketchPlugin_Constraint();
};
-typedef std::shared_ptr<SketchPlugin_Constraint> ConstraintPtr;
+using ConstraintPtr = std::shared_ptr<SketchPlugin_Constraint>;
#endif
public GeomAPI_IPresentable {
protected:
/// \brief Use plugin manager for features creation
- SketchPlugin_ConstraintBase() {}
+ SketchPlugin_ConstraintBase() = default;
};
#endif
return MY_CONSTRAINT_COINCIDENCE_ID;
}
/// \brief Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_ConstraintCoincidence::ID();
return MY_KIND;
}
/// Returns the AIS preview
- SKETCHPLUGIN_EXPORT virtual AISObjectPtr
- getAISObject(AISObjectPtr thePrevious);
+ SKETCHPLUGIN_EXPORT AISObjectPtr
+ getAISObject(AISObjectPtr thePrevious) override;
/// \brief Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// \brief Request for initialization of data model of the feature: adding all
/// attributes
- SKETCHPLUGIN_EXPORT virtual void initAttributes();
+ SKETCHPLUGIN_EXPORT void initAttributes() override;
/// Creates a constraint on two points
/// \param theSketch a sketch feature
#include <Config_PropManager.h>
-SketchPlugin_ConstraintEqual::SketchPlugin_ConstraintEqual() {}
+SketchPlugin_ConstraintEqual::SketchPlugin_ConstraintEqual() = default;
void SketchPlugin_ConstraintEqual::initAttributes() {
data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(),
return MY_CONSTRAINT_EQUAL_ID;
}
/// \brief Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_ConstraintEqual::ID();
return MY_KIND;
}
/// \brief Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// \brief Request for initialization of data model of the feature: adding all
/// attributes
- SKETCHPLUGIN_EXPORT virtual void initAttributes();
+ SKETCHPLUGIN_EXPORT void initAttributes() override;
/// Returns the AIS preview
- SKETCHPLUGIN_EXPORT virtual AISObjectPtr
- getAISObject(AISObjectPtr thePrevious);
+ SKETCHPLUGIN_EXPORT AISObjectPtr
+ getAISObject(AISObjectPtr thePrevious) override;
/// \brief Use plugin manager for features creation
SketchPlugin_ConstraintEqual();
#include <SketchPlugin_Sketch.h>
#include <SketcherPrs_Factory.h>
-//#include <SketcherPrs_Tools.h>
+// #include <SketcherPrs_Tools.h>
#include <Config_PropManager.h>
}
/// \brief Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_ConstraintMiddle::ID();
return MY_KIND;
}
/// Called on change of any argument-attribute of this object
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// \brief Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// \brief Request for initialization of data model of the feature: adding all
/// attributes
- SKETCHPLUGIN_EXPORT virtual void initAttributes();
+ SKETCHPLUGIN_EXPORT void initAttributes() override;
/// Returns the AIS preview
- SKETCHPLUGIN_EXPORT virtual AISObjectPtr
- getAISObject(AISObjectPtr thePrevious);
+ SKETCHPLUGIN_EXPORT AISObjectPtr
+ getAISObject(AISObjectPtr thePrevious) override;
/// \brief Use plugin manager for features creation
SketchPlugin_ConstraintMiddle();
return MY_CONSTRAINT_RADIUS_ID;
}
/// \brief Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_ConstraintRadius::ID();
return MY_KIND;
}
}
/// \brief Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// Computes the attribute value on the base of other attributes if the value
/// can be computed \param theAttributeId an attribute index to be computed
/// \return a boolean value about it is computed
- SKETCHPLUGIN_EXPORT virtual bool compute(const std::string &theAttributeId);
+ SKETCHPLUGIN_EXPORT bool compute(const std::string &theAttributeId) override;
/// \brief Request for initialization of data model of the feature: adding all
/// attributes
- SKETCHPLUGIN_EXPORT virtual void initAttributes();
+ SKETCHPLUGIN_EXPORT void initAttributes() override;
/// Retuns the parameters of color definition in the resources config manager
- SKETCHPLUGIN_EXPORT virtual void colorConfigInfo(std::string &theSection,
- std::string &theName,
- std::string &theDefault);
+ SKETCHPLUGIN_EXPORT void colorConfigInfo(std::string &theSection,
+ std::string &theName,
+ std::string &theDefault) override;
/// Returns the AIS preview
- SKETCHPLUGIN_EXPORT virtual AISObjectPtr
- getAISObject(AISObjectPtr thePrevious);
+ SKETCHPLUGIN_EXPORT AISObjectPtr
+ getAISObject(AISObjectPtr thePrevious) override;
/// Called on change of any argument-attribute of this object
/// \param theID identifier of changed attribute
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// \brief Use plugin manager for features creation
SketchPlugin_ConstraintRadius();
return MY_CONSTRAINT_RIGID_ID;
}
/// \brief Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_ConstraintRigid::ID();
return MY_KIND;
}
/// Returns the AIS preview
- SKETCHPLUGIN_EXPORT virtual AISObjectPtr
- getAISObject(AISObjectPtr thePrevious);
+ SKETCHPLUGIN_EXPORT AISObjectPtr
+ getAISObject(AISObjectPtr thePrevious) override;
/// \brief Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// \brief Request for initialization of data model of the feature: adding all
/// attributes
- SKETCHPLUGIN_EXPORT virtual void initAttributes();
+ SKETCHPLUGIN_EXPORT void initAttributes() override;
/// \brief Use plugin manager for features creation
SketchPlugin_ConstraintRigid();
return MY_CONSTRAINT_TANGENT_ID;
}
/// \brief Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_ConstraintTangent::ID();
return MY_KIND;
}
/// \brief Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// \brief Request for initialization of data model of the feature: adding all
/// attributes
- SKETCHPLUGIN_EXPORT virtual void initAttributes();
+ SKETCHPLUGIN_EXPORT void initAttributes() override;
/// Returns the AIS preview
- SKETCHPLUGIN_EXPORT virtual AISObjectPtr
- getAISObject(AISObjectPtr thePrevious);
+ SKETCHPLUGIN_EXPORT AISObjectPtr
+ getAISObject(AISObjectPtr thePrevious) override;
/// \brief Use plugin manager for features creation
SketchPlugin_ConstraintTangent();
}
/// Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_Ellipse::ID();
return MY_KIND;
}
/// Returns true is sketch element is under the rigid constraint
- SKETCHPLUGIN_EXPORT virtual bool isFixed();
+ SKETCHPLUGIN_EXPORT bool isFixed() override;
/// Called on change of any argument-attribute of this object
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// Use plugin manager for features creation
SketchPlugin_Ellipse();
protected:
/// \brief Initializes attributes of derived class.
- virtual void initDerivedClassAttributes();
+ void initDerivedClassAttributes() override;
private:
bool fillCharacteristicPoints();
}
/// Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_EllipticArc::ID();
return MY_KIND;
}
/// Returns true is sketch element is under the rigid constraint
- SKETCHPLUGIN_EXPORT virtual bool isFixed();
+ SKETCHPLUGIN_EXPORT bool isFixed() override;
/// Called on change of any argument-attribute of this object
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// Use plugin manager for features creation
SketchPlugin_EllipticArc();
protected:
/// \brief Initializes attributes of derived class.
- virtual void initDerivedClassAttributes();
+ void initDerivedClassAttributes() override;
private:
bool fillCharacteristicPoints();
public:
/// Returns true if this feature must be displayed in the history (top level
/// of Part tree)
- SKETCHPLUGIN_EXPORT virtual bool isInHistory() { return false; }
+ SKETCHPLUGIN_EXPORT bool isInHistory() override { return false; }
/// Returns true of the feature is created basing on the external shape of
/// not-this-sketch object
}
bool SketchPlugin_Line::isFixed() {
- return data()->selection(EXTERNAL_ID())->context().get() != NULL;
+ return data()->selection(EXTERNAL_ID())->context().get() != nullptr;
}
void SketchPlugin_Line::attributeChanged(const std::string &theID) {
}
/// Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind();
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override;
/// Returns true is sketch element is under the rigid constraint
- SKETCHPLUGIN_EXPORT virtual bool isFixed();
+ SKETCHPLUGIN_EXPORT bool isFixed() override;
/// Request for initialization of data model of the feature: adding all
/// attributes
- virtual void initAttributes();
+ void initAttributes() override;
/// Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// Apply information of the message to current object. It fills start
/// attribute of the current feature by last attribute of the message feature,
/// build coincidence if message has selected object
- virtual std::string
- processEvent(const std::shared_ptr<Events_Message> &theMessage);
+ std::string
+ processEvent(const std::shared_ptr<Events_Message> &theMessage) override;
/// Called on change of any argument-attribute of this object
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Use plugin manager for features creation
SketchPlugin_Line();
protected:
/// \brief Initializes attributes of derived class.
- virtual void initDerivedClassAttributes();
+ void initDerivedClassAttributes() override;
};
#endif
}
/// Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_MacroArc::ID();
return MY_KIND;
}
/// \brief Request for initialization of data model of the feature: adding all
/// attributes.
- SKETCHPLUGIN_EXPORT virtual void initAttributes();
+ SKETCHPLUGIN_EXPORT void initAttributes() override;
/// Called on change of any argument-attribute of this object
/// \param theID identifier of changed attribute
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Returns the AIS preview
- virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
+ AISObjectPtr getAISObject(AISObjectPtr thePrevious) override;
/// Creates an arc-shape
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// Reimplemented from ModelAPI_Feature::isMacro().
- SKETCHPLUGIN_EXPORT virtual bool isMacro() const { return true; };
+ SKETCHPLUGIN_EXPORT bool isMacro() const override { return true; };
- SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; };
+ SKETCHPLUGIN_EXPORT bool isPreviewNeeded() const override { return false; };
/// Apply information of the message to current object. It fills reference
/// object, tangent type and tangent point refence in case of tangent arc
- virtual std::string
- processEvent(const std::shared_ptr<Events_Message> &theMessage);
+ std::string
+ processEvent(const std::shared_ptr<Events_Message> &theMessage) override;
/// Use plugin manager for features creation.
SketchPlugin_MacroArc();
static const double tolerance = 1.e-7;
-SketchPlugin_Offset::SketchPlugin_Offset() {}
+SketchPlugin_Offset::SketchPlugin_Offset() = default;
void SketchPlugin_Offset::initAttributes() {
AttributeRefListPtr anEdgesAttr =
// 5.c. Make wire
ListOfShape aTopoChain;
- std::list<FeaturePtr>::iterator aChainIt = aChain.begin();
+ auto aChainIt = aChain.begin();
for (; aChainIt != aChain.end(); ++aChainIt) {
FeaturePtr aChainFeature = (*aChainIt);
GeomShapePtr aTopoEdge = aChainFeature->lastResult()->shape();
std::set<AttributePoint2DPtr> aCoincPoints =
SketchPlugin_Tools::findPointsCoincidentToPoint(theEndPoint);
- std::set<AttributePoint2DPtr>::iterator aPointsIt = aCoincPoints.begin();
+ auto aPointsIt = aCoincPoints.begin();
for (; aPointsIt != aCoincPoints.end(); aPointsIt++) {
AttributePoint2DPtr aP = (*aPointsIt);
FeaturePtr aCoincFeature =
std::map<ObjectPtr, std::list<ObjectPtr>> aMapExistent;
std::list<ObjectPtr> anObjectsToRemove;
std::list<ObjectPtr> aSelectedList = aSelectedRefList->list();
- for (std::list<ObjectPtr>::iterator aSIt = aSelectedList.begin();
- aSIt != aSelectedList.end(); ++aSIt) {
- aMapExistent[*aSIt] = std::list<ObjectPtr>();
+ for (auto &aSIt : aSelectedList) {
+ aMapExistent[aSIt] = std::list<ObjectPtr>();
}
for (int anIndex = 0, aSize = anOffsetRefList->size(); anIndex < aSize;
++anIndex) {
int aBaseIndex = anOffsetToBaseMap->value(anIndex);
if (aBaseIndex >= 0) {
ObjectPtr aBaseObj = aBaseRefList->object(aBaseIndex);
- std::map<ObjectPtr, std::list<ObjectPtr>>::iterator aFound =
- aMapExistent.find(aBaseObj);
+ auto aFound = aMapExistent.find(aBaseObj);
if (aFound != aMapExistent.end())
aFound->second.push_back(aCurrent);
else
int aBaseListIndex = 0, anOffsetListIndex = 0;
std::list<int> anOffsetBaseBackRefs;
std::set<GeomShapePtr, GeomAPI_Shape::ComparatorWithOri> aProcessedOffsets;
- for (std::list<ObjectPtr>::iterator aSIt = aSelectedList.begin();
- aSIt != aSelectedList.end(); ++aSIt) {
+ for (auto &aSIt : aSelectedList) {
// find an offseted edge
- FeaturePtr aBaseFeature = ModelAPI_Feature::feature(*aSIt);
+ FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aSIt);
GeomShapePtr aBaseShape = aBaseFeature->lastResult()->shape();
ListOfShape aNewShapes;
- for (ListOfMakeShape::const_iterator anAlgoIt = theOffsetAlgos.begin();
- anAlgoIt != theOffsetAlgos.end(); ++anAlgoIt) {
- (*anAlgoIt)->generated(aBaseShape, aNewShapes);
+ for (const auto &theOffsetAlgo : theOffsetAlgos) {
+ theOffsetAlgo->generated(aBaseShape, aNewShapes);
if (!aNewShapes.empty()) {
- reorderShapes(aNewShapes, (*anAlgoIt)->shape());
+ reorderShapes(aNewShapes, theOffsetAlgo->shape());
break;
}
}
// store base feature
- setRefListValue(aBaseRefList, aBaseListSize, *aSIt, aBaseListIndex);
+ setRefListValue(aBaseRefList, aBaseListSize, aSIt, aBaseListIndex);
// create or update an offseted feature
- const std::list<ObjectPtr> &anImages = aMapExistent[*aSIt];
- std::list<ObjectPtr>::const_iterator anImgIt = anImages.begin();
- for (ListOfShape::iterator aNewIt = aNewShapes.begin();
- aNewIt != aNewShapes.end(); ++aNewIt) {
+ const std::list<ObjectPtr> &anImages = aMapExistent[aSIt];
+ auto anImgIt = anImages.begin();
+ for (auto &aNewShape : aNewShapes) {
FeaturePtr aNewFeature;
if (anImgIt != anImages.end())
aNewFeature = ModelAPI_Feature::feature(*anImgIt++);
- updateExistentOrCreateNew(*aNewIt, aNewFeature, anObjectsToRemove);
- aProcessedOffsets.insert(*aNewIt);
+ updateExistentOrCreateNew(aNewShape, aNewFeature, anObjectsToRemove);
+ aProcessedOffsets.insert(aNewShape);
// store an offseted feature
setRefListValue(anOffsetRefList, anOffsetListSize, aNewFeature,
anObjectsToRemove.insert(anObjectsToRemove.end(), anImgIt, anImages.end());
}
// create arcs generated from vertices
- for (ListOfMakeShape::const_iterator anAlgoIt = theOffsetAlgos.begin();
- anAlgoIt != theOffsetAlgos.end(); ++anAlgoIt) {
- GeomShapePtr aCurWire = (*anAlgoIt)->shape();
+ for (const auto &theOffsetAlgo : theOffsetAlgos) {
+ GeomShapePtr aCurWire = theOffsetAlgo->shape();
GeomAPI_ShapeExplorer anExp(aCurWire, GeomAPI_Shape::EDGE);
for (; anExp.more(); anExp.next()) {
GeomShapePtr aCurEdge = anExp.current();
anOffsetToBaseMap->setSize((int)anOffsetBaseBackRefs.size(), false);
int anIndex = 0;
- for (std::list<int>::iterator anIt = anOffsetBaseBackRefs.begin();
- anIt != anOffsetBaseBackRefs.end(); ++anIt) {
- anOffsetToBaseMap->setValue(anIndex++, *anIt, false);
+ for (int &anOffsetBaseBackRef : anOffsetBaseBackRefs) {
+ anOffsetToBaseMap->setValue(anIndex++, anOffsetBaseBackRef, false);
}
// remove unused objects
std::set<FeaturePtr> aSet;
- for (std::list<ObjectPtr>::iterator anIt = anObjectsToRemove.begin();
- anIt != anObjectsToRemove.end(); ++anIt) {
- FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
+ for (auto &anIt : anObjectsToRemove) {
+ FeaturePtr aFeature = ModelAPI_Feature::feature(anIt);
if (aFeature)
aSet.insert(aFeature);
}
}
if (!theFeature) {
// try to find appropriate feature in the pool
- for (std::list<ObjectPtr>::iterator it = thePoolOfFeatures.begin();
- it != thePoolOfFeatures.end(); ++it) {
+ for (auto it = thePoolOfFeatures.begin(); it != thePoolOfFeatures.end();
+ ++it) {
FeaturePtr aCurFeature = ModelAPI_Feature::feature(*it);
if (aCurFeature->getKind() == theFeatureKind) {
theFeature = aCurFeature;
Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY);
ModelAPI_EventCreator::get()->sendUpdated(theFeature, aRedisplayEvent);
const std::list<ResultPtr> &aResults = theFeature->results();
- for (std::list<ResultPtr>::const_iterator anIt = aResults.begin();
- anIt != aResults.end(); ++anIt)
- ModelAPI_EventCreator::get()->sendUpdated(*anIt, aRedisplayEvent);
+ for (const auto &aResult : aResults)
+ ModelAPI_EventCreator::get()->sendUpdated(aResult, aRedisplayEvent);
}
}
theResult->attribute(SketchPlugin_BSpline::POLES_ID()));
std::list<GeomPointPtr> aPoles = aBSpline->poles();
aPolesAttr->setSize((int)aPoles.size());
- std::list<GeomPointPtr>::iterator anIt = aPoles.begin();
+ auto anIt = aPoles.begin();
for (int anIndex = 0; anIt != aPoles.end(); ++anIt, ++anIndex) {
GeomPnt2dPtr aPoleInSketch = sketch()->to2D(*anIt);
aPolesAttr->setPnt(anIndex, aPoleInSketch);
aWeightsAttr->setValue(anIndex, 1.0);
} else { // non-rational B-spline
aWeightsAttr->setSize((int)aWeights.size());
- std::list<double>::iterator aWIt = aWeights.begin();
+ auto aWIt = aWeights.begin();
for (int anIndex = 0; aWIt != aWeights.end(); ++aWIt, ++anIndex)
aWeightsAttr->setValue(anIndex, *aWIt);
}
std::list<double> aKnots = aBSpline->knots();
int aSize = (int)aKnots.size();
aKnotsAttr->setSize(aSize);
- std::list<double>::iterator aKIt = aKnots.begin();
+ auto aKIt = aKnots.begin();
for (int index = 0; index < aSize; ++index, ++aKIt)
aKnotsAttr->setValue(index, *aKIt);
std::list<int> aMultiplicities = aBSpline->mults();
aSize = (int)aMultiplicities.size();
aMultsAttr->setSize(aSize);
- std::list<int>::iterator aMIt = aMultiplicities.begin();
+ auto aMIt = aMultiplicities.begin();
for (int index = 0; index < aSize; ++index, ++aMIt)
aMultsAttr->setValue(index, *aMIt);
}
reflist(SketchPlugin_Constraint::ENTITY_B());
std::list<ObjectPtr> anOffsetList = anOffsetAttr->list();
std::set<FeaturePtr> aFeaturesToBeRemoved;
- for (std::list<ObjectPtr>::iterator anIt = anOffsetList.begin();
- anIt != anOffsetList.end(); ++anIt) {
- FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
+ for (auto &anIt : anOffsetList) {
+ FeaturePtr aFeature = ModelAPI_Feature::feature(anIt);
if (aFeature)
aFeaturesToBeRemoved.insert(aFeature);
}
aProcessedEdgesSet, aChain, false);
}
- std::list<FeaturePtr>::iterator aChainIt = aChain.begin();
+ auto aChainIt = aChain.begin();
for (; aChainIt != aChain.end(); ++aChainIt) {
FeaturePtr aChainFeature = (*aChainIt);
if (aSelectedSet.find(aChainFeature) == aSelectedSet.end()) {
// find vertices for fillet
std::set<GeomShapePtr, GeomAPI_Shape::Comparator> aFilletVertices;
- for (MapShapeToShapes::const_iterator anIt = aSubshapes.begin();
- anIt != aSubshapes.end(); ++anIt) {
+ for (const auto &aSubshape : aSubshapes) {
// vertex should have 2 adjacent edges
- if (anIt->second.size() != 2)
+ if (aSubshape.second.size() != 2)
continue;
// both edges should be linear
ListOfShape anEdges;
- anEdges.insert(anEdges.end(), anIt->second.begin(), anIt->second.end());
+ anEdges.insert(anEdges.end(), aSubshape.second.begin(),
+ aSubshape.second.end());
GeomEdgePtr anEdge1(new GeomAPI_Edge(anEdges.front()));
GeomEdgePtr anEdge2(new GeomAPI_Edge(anEdges.back()));
if (!anEdge1->isLine() || !anEdge2->isLine())
continue;
// skip vertices, which smoothly connect adjacent edges
- GeomVertexPtr aSharedVertex(new GeomAPI_Vertex(anIt->first));
+ GeomVertexPtr aSharedVertex(new GeomAPI_Vertex(aSubshape.first));
if (GeomAlgoAPI_ShapeTools::isTangent(anEdge1, anEdge2, aSharedVertex))
continue;
- aFilletVertices.insert(anIt->first);
+ aFilletVertices.insert(aSubshape.first);
}
if (!aFilletVertices.empty()) {
if (aFailedVertices.size() != 0) {
// Exclude failed vertices and also vertices, joined
// with failed by one edge, and run algorithm once again
- ListOfShape::iterator itVertices = aFailedVertices.begin();
+ auto itVertices = aFailedVertices.begin();
for (; itVertices != aFailedVertices.end(); itVertices++) {
GeomShapePtr aFailedVertex = *itVertices;
aFilletVertices.erase(aFailedVertex);
// remove also neighbour vertices
- MapShapeToShapes::const_iterator anIt =
- aSubshapes.find(aFailedVertex);
+ auto anIt = aSubshapes.find(aFailedVertex);
if (anIt != aSubshapes.end()) { // should be always true
ListOfShape anEdges;
anEdges.insert(anEdges.end(), anIt->second.begin(),
}
/// Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_Offset::ID();
return MY_KIND;
}
}
/// Called on change of any argument-attribute of this object
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
- SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return true; }
+ SKETCHPLUGIN_EXPORT bool isPreviewNeeded() const override { return true; }
/// Find edges connected by coincident boundary constraint and composing a
/// wire with the already selected segments. It means that not more than 2
/// edges can be connected with the coincident point. \param[in] theActionId
/// action key id (in following form: Action#Index) \return \c false in case
/// the action not performed.
- SKETCHPLUGIN_EXPORT virtual bool customAction(const std::string &theActionId);
+ SKETCHPLUGIN_EXPORT bool
+ customAction(const std::string &theActionId) override;
/// Returns the AIS preview
- SKETCHPLUGIN_EXPORT virtual AISObjectPtr
- getAISObject(AISObjectPtr thePrevious);
+ SKETCHPLUGIN_EXPORT AISObjectPtr
+ getAISObject(AISObjectPtr thePrevious) override;
/// Use plugin manager for features creation.
SketchPlugin_Offset();
protected:
/// \brief Initializes attributes of derived class.
- virtual void initAttributes();
+ void initAttributes() override;
private:
/// Find all wires connected with the selected edges
#define SKETCH_OVERCONSTRAINT_COLOR "255,0,0"
#define SKETCH_FULLY_CONSTRAINED_COLOR "0,150,0"
-//#define SET_PLANES_COLOR_IN_PREFERENCES
+// #define SET_PLANES_COLOR_IN_PREFERENCES
// the only created instance of this plugin
static SketchPlugin_Plugin *MY_SKETCH_INSTANCE = new SketchPlugin_Plugin();
return MY_COORD_ID;
}
/// Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_Point::ID();
return MY_KIND;
}
/// Returns true is sketch element is under the rigid constraint
- SKETCHPLUGIN_EXPORT virtual bool isFixed();
+ SKETCHPLUGIN_EXPORT bool isFixed() override;
/// Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// Called on change of any argument-attribute of this object: for external
/// point
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Use plugin manager for features creation
SketchPlugin_Point();
protected:
/// \brief Initializes attributes of derived class.
- virtual void initDerivedClassAttributes();
+ void initDerivedClassAttributes() override;
};
#endif
}
SketchPlugin_Projection::SketchPlugin_Projection()
- : SketchPlugin_SketchEntity(), myIsComputing(false) {}
+ : SketchPlugin_SketchEntity() {}
void SketchPlugin_Projection::initDerivedClassAttributes() {
data()->addAttribute(EXTERNAL_FEATURE_ID(),
FeaturePtr aProjection = ModelAPI_Feature::feature(aRefAttr->object());
if (isKeepReference(string(KEEP_REFERENCE_ID())) && !lastResult().get()) {
- bool hasProjResult = aProjection->lastResult().get() != NULL;
+ bool hasProjResult = aProjection->lastResult().get() != nullptr;
ResultConstructionPtr aConstr = document()->createConstruction(data());
if (hasProjResult)
aConstr->setShape(aProjection->lastResult()->shape());
theProjection->attribute(SketchPlugin_BSpline::POLES_ID()));
std::list<GeomPointPtr> aPoles = aBSpline.poles();
aPolesAttr->setSize((int)aPoles.size());
- std::list<GeomPointPtr>::iterator anIt = aPoles.begin();
+ auto anIt = aPoles.begin();
for (int anIndex = 0; anIt != aPoles.end(); ++anIt, ++anIndex) {
GeomPnt2dPtr aPoleInSketch = sketch()->to2D(*anIt);
aPolesAttr->setPnt(anIndex, aPoleInSketch);
aWeightsAttr->setValue(anIndex, 1.0);
} else { // non-rational B-spline
aWeightsAttr->setSize((int)aWeights.size());
- std::list<double>::iterator aWIt = aWeights.begin();
+ auto aWIt = aWeights.begin();
for (int anIndex = 0; aWIt != aWeights.end(); ++aWIt, ++anIndex)
aWeightsAttr->setValue(anIndex, *aWIt);
}
std::list<double> aKnots = aBSpline.knots();
int aSize = (int)aKnots.size();
aKnotsAttr->setSize(aSize);
- std::list<double>::iterator aKIt = aKnots.begin();
+ auto aKIt = aKnots.begin();
for (int index = 0; index < aSize; ++index, ++aKIt)
aKnotsAttr->setValue(index, *aKIt);
std::list<int> aMultiplicities = aBSpline.mults();
aSize = (int)aMultiplicities.size();
aMultsAttr->setSize(aSize);
- std::list<int>::iterator aMIt = aMultiplicities.begin();
+ auto aMIt = aMultiplicities.begin();
for (int index = 0; index < aSize; ++index, ++aMIt)
aMultsAttr->setValue(index, *aMIt);
return MY_PROJECTION_ID;
}
/// Returns the kind of a feature
- virtual const std::string &getKind() {
+ const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_Projection::ID();
return MY_KIND;
}
}
/// Returns true because projected feature is always external
- virtual bool isFixed() { return true; }
+ bool isFixed() override { return true; }
/// Returns true if the feature and the feature results can be displayed.
/// \return false
- SKETCHPLUGIN_EXPORT virtual bool canBeDisplayed() const { return false; }
+ SKETCHPLUGIN_EXPORT bool canBeDisplayed() const override { return false; }
/// Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// Called on change of any argument-attribute of this object: for external
/// point
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Returns true if this feature is used as macro: creates other features and
/// then removed. This feature may change its macro-state according to
/// selected item. \returns false by default
- SKETCHPLUGIN_EXPORT virtual bool isMacro() const;
+ SKETCHPLUGIN_EXPORT bool isMacro() const override;
/// Use plugin manager for features creation
SketchPlugin_Projection();
protected:
/// \brief Initializes attributes of derived class.
- virtual void initDerivedClassAttributes();
+ void initDerivedClassAttributes() override;
/// \brief Initializes attributes of keeping the reference to the original
/// shape.
- virtual void initDerivedClassAttributes2();
+ void initDerivedClassAttributes2() override;
private:
/// \brief Find projection of a feature onto sketch plane
FeaturePtr &theProjection, const std::set<std::string> &theSupportedTypes,
const std::string &theRequestedFeature = std::string());
- bool myIsComputing;
+ bool myIsComputing{false};
};
#endif
}
/// Returns the kind of a feature
- SKETCHPLUGIN_EXPORT virtual const std::string &getKind() {
+ SKETCHPLUGIN_EXPORT const std::string &getKind() override {
static std::string MY_KIND = SketchPlugin_Sketch::ID();
return MY_KIND;
}
/// Creates a new part document if needed
- SKETCHPLUGIN_EXPORT virtual void execute();
+ SKETCHPLUGIN_EXPORT void execute() override;
/// Request for initialization of data model of the feature: adding all
/// attributes
- SKETCHPLUGIN_EXPORT virtual void initAttributes();
+ SKETCHPLUGIN_EXPORT void initAttributes() override;
/// Converts a 2D sketch space point into point in 3D space
/// \param theX an X coordinate
/// Returns true if this feature must be displayed in the history (top level
/// of Part tree)
- SKETCHPLUGIN_EXPORT virtual bool isInHistory() { return true; }
+ SKETCHPLUGIN_EXPORT bool isInHistory() override { return true; }
/// Use plugin manager for features creation
SketchPlugin_Sketch();
}
/// appends a feature to the sketch sub-elements container
- SKETCHPLUGIN_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
- addFeature(std::string theID);
+ SKETCHPLUGIN_EXPORT std::shared_ptr<ModelAPI_Feature>
+ addFeature(std::string theID) override;
/// Just to synchronise the container of sub-features
- virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature);
+ void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature) override;
/// Returns the number of sub-elements
- SKETCHPLUGIN_EXPORT virtual int numberOfSubs(bool forTree = false) const;
+ SKETCHPLUGIN_EXPORT int numberOfSubs(bool forTree = false) const override;
/// Returns the sub-feature by zero-base index
- SKETCHPLUGIN_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
- subFeature(const int theIndex, bool forTree = false);
+ SKETCHPLUGIN_EXPORT std::shared_ptr<ModelAPI_Feature>
+ subFeature(const int theIndex, bool forTree = false) override;
/// Returns the sub-feature unique identifier in this composite feature by
/// index
- SKETCHPLUGIN_EXPORT virtual int subFeatureId(const int theIndex) const;
+ SKETCHPLUGIN_EXPORT int subFeatureId(const int theIndex) const override;
/// Returns true if feature or reuslt belong to this composite feature as subs
- SKETCHPLUGIN_EXPORT virtual bool isSub(ObjectPtr theObject) const;
+ SKETCHPLUGIN_EXPORT bool isSub(ObjectPtr theObject) const override;
- SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string &theID);
+ SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID) override;
/// Performs some custom feature specific functionality (normally called by
/// some GUI button) \param theActionId an action key \return a boolean value
/// about it is performed
- SKETCHPLUGIN_EXPORT virtual bool customAction(const std::string &theActionId);
+ SKETCHPLUGIN_EXPORT bool
+ customAction(const std::string &theActionId) override;
/// \brief Create a result for the point in the attribute if the attribute is
/// initialized \param theFeature a source feature \param theSketch a sketch
}
/// Width of the auxiliary line
- inline static const int SKETCH_LINE_WIDTH_AUXILIARY() { return 2; }
+ inline static int SKETCH_LINE_WIDTH_AUXILIARY() { return 2; }
/// Width of the line
- inline static const int SKETCH_LINE_WIDTH() {
+ inline static int SKETCH_LINE_WIDTH() {
return Config_PropManager::integer("Visualization", "sketch_line_width");
}
/// Style of the auxiliary line
- inline static const int SKETCH_LINE_STYLE_AUXILIARY() { return 3; }
+ inline static int SKETCH_LINE_STYLE_AUXILIARY() { return 3; }
/// Style of the line
- inline static const int SKETCH_LINE_STYLE() { return 0; }
+ inline static int SKETCH_LINE_STYLE() { return 0; }
/// Request for initialization of data model of the feature: adding all
/// attributes
- virtual void initAttributes();
+ void initAttributes() override;
/// Returns true of the feature is created basing on the external shape of
/// not-this-sketch object
- virtual bool isExternal() const {
+ bool isExternal() const override {
AttributeSelectionPtr aAttr = data()->selection(EXTERNAL_ID());
if (aAttr)
- return aAttr->context().get() != NULL && !aAttr->isInvalid();
+ return aAttr->context().get() != nullptr && !aAttr->isInvalid();
return false;
}
/// Returns true of the feature is a copy of other feature
- virtual bool isCopy() const {
+ bool isCopy() const override {
AttributeBooleanPtr anAttr = data()->boolean(COPY_ID());
if (anAttr.get()) {
return anAttr->value();
#include <cmath>
-//#define CREATE_CONSTRAINTS
+// #define CREATE_CONSTRAINTS
#ifdef DEBUG_SPLIT
#include <iostream>
#define PI 3.1415926535897932
-//#ifndef WNT
-// #define COMPILATION_CORRECTION
-//#endif
+// #ifndef WNT
+// #define COMPILATION_CORRECTION
+// #endif
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Angle, PrsDim_AngleDimension);
#include <Standard_Version.hxx>
#include <TCollection_ExtendedString.hxx>
-//#ifndef WNT
-// #define COMPILATION_CORRECTION
-//#endif
+// #ifndef WNT
+// #define COMPILATION_CORRECTION
+// #endif
// it is not possible to use 0x2211 as summ symbol because it is not supported
// by debian Linux platform
#ifndef SketcherPrs_DimensionStyleListener_H
#define SketcherPrs_DimensionStyleListener_H
-//#include <Events_Listener.h>
+// #include <Events_Listener.h>
#include <ModelAPI_AttributeDouble.h>
#include <PrsDim_Dimension.hxx>
SketchPlugin_Sketch *theSketcher);
/// Destructor
- Standard_EXPORT ~SketcherPrs_Radius();
+ Standard_EXPORT ~SketcherPrs_Radius() override;
DEFINE_STANDARD_RTTIEXT(SketcherPrs_Radius, PrsDim_RadiusDimension)
protected:
/// Redefinition of virtual function
- Standard_EXPORT virtual void
+ Standard_EXPORT void
Compute(const Handle(PrsMgr_PresentationManager3d) & thePresentationManager,
const Handle(Prs3d_Presentation) & thePresentation,
- const Standard_Integer theMode = 0);
+ const Standard_Integer theMode = 0) override;
/// Redefinition of virtual function
- Standard_EXPORT virtual void
- ComputeSelection(const Handle(SelectMgr_Selection) & aSelection,
- const Standard_Integer aMode);
+ Standard_EXPORT void ComputeSelection(const Handle(SelectMgr_Selection) &
+ aSelection,
+ const Standard_Integer aMode) override;
private:
/// Constraint feature
#ifndef XGUI_H
#define XGUI_H
-//#define BEFORE_TRIHEDRON_PATCH
+// #define BEFORE_TRIHEDRON_PATCH
#if defined XGUI_EXPORTS
#if defined WIN32
#include <ModuleBase_IModule.h>
#include <ModuleBase_IWorkshop.h>
-//#define DEBUG_ACTIVE_SELECTOR
+// #define DEBUG_ACTIVE_SELECTOR
#ifdef DEBUG_ACTIVE_SELECTOR
void debugInfo(const QString &theMessage,
//********************************************************************
XGUI_ActiveControlMgr::XGUI_ActiveControlMgr(ModuleBase_IWorkshop *theWorkshop)
- : myWorkshop(theWorkshop), myActiveSelector(0), myIsBlocked(false) {
+ : myWorkshop(theWorkshop) {
connect(myWorkshop, SIGNAL(selectionChanged()), this,
SLOT(onSelectionChanged()));
}
//********************************************************************
XGUI_ActiveControlSelector *
XGUI_ActiveControlMgr::getSelector(const QString &theType) {
- XGUI_ActiveControlSelector *aSelector = 0;
+ XGUI_ActiveControlSelector *aSelector = nullptr;
for (int i = 0, aCount = mySelectors.count(); i < aCount; i++) {
if (mySelectors[i]->getType() != theType)
continue;
//********************************************************************
void XGUI_ActiveControlMgr::onSelectorActivated() {
- XGUI_ActiveControlSelector *aSelector =
- qobject_cast<XGUI_ActiveControlSelector *>(sender());
+ auto *aSelector = qobject_cast<XGUI_ActiveControlSelector *>(sender());
if (!aSelector || aSelector == myActiveSelector)
return;
//********************************************************************
void XGUI_ActiveControlMgr::onSelectorDeactivated() {
- XGUI_ActiveControlSelector *aSelector =
- qobject_cast<XGUI_ActiveControlSelector *>(sender());
+ auto *aSelector = qobject_cast<XGUI_ActiveControlSelector *>(sender());
deactivateSelector(aSelector);
}
myIsBlocked = true;
myActiveSelector->setActive(false);
- activateSelector(NULL);
+ activateSelector(nullptr);
- XGUI_ActiveControlSelector *aSelectorToBeActivated = 0;
+ XGUI_ActiveControlSelector *aSelectorToBeActivated = nullptr;
for (int i = 0, aCount = mySelectors.count(); i < aCount; i++) {
if (!mySelectors[i]->needToBeActivated())
continue;
/// \param theWorkshop the current workshop instance
XGUI_EXPORT XGUI_ActiveControlMgr(ModuleBase_IWorkshop *theWorkshop);
- XGUI_EXPORT virtual ~XGUI_ActiveControlMgr(){};
+ XGUI_EXPORT ~XGUI_ActiveControlMgr() override = default;
+ ;
/// Register selector to process activation of control
void addSelector(XGUI_ActiveControlSelector *theSelector);
ModuleBase_IWorkshop *myWorkshop; ///< the current workshop
QList<XGUI_ActiveControlSelector *> mySelectors; ///< workshop selectors
- XGUI_ActiveControlSelector *myActiveSelector; ///< active selector
+ XGUI_ActiveControlSelector *myActiveSelector{0}; ///< active selector
- bool myIsBlocked; ///< blocking flag to avoid cycling signals processing
+ bool myIsBlocked{
+ false}; ///< blocking flag to avoid cycling signals processing
};
#endif
public:
/// Constructor
/// \param theWorkshop the current workshop instance
- XGUI_EXPORT XGUI_ActiveControlSelector(){};
+ XGUI_EXPORT XGUI_ActiveControlSelector() = default;
+ ;
/// Destructor
- XGUI_EXPORT virtual ~XGUI_ActiveControlSelector(){};
+ XGUI_EXPORT ~XGUI_ActiveControlSelector() override = default;
+ ;
/// Returns name of the selector
XGUI_EXPORT virtual QString getType() = 0;
#include <AppElements_MainWindow.h>
#endif
-//#include "PartSetPlugin_Part.h"
+// #include "PartSetPlugin_Part.h"
#include <ModelAPI_AttributeDocRef.h>
#include <ModelAPI_AttributeReference.h>
XGUI_DataModel(QObject *theParent);
/// Destructor
- virtual ~XGUI_DataModel();
+ ~XGUI_DataModel() override;
void setRoot(ModuleBase_ITreeNode *theRoot) { myRoot = theRoot; }
/// Event Listener method
/// \param theMessage an event message
- virtual void processEvent(const std::shared_ptr<Events_Message> &theMessage);
+ void processEvent(const std::shared_ptr<Events_Message> &theMessage) override;
//! Returns an object by the given Model index.
//! Returns 0 if the given index is not index of an object
/// Returns the data stored under the given role for the item referred to by
/// the index. \param theIndex a model index \param theRole a data role (see
/// Qt::ItemDataRole)
- virtual QVariant data(const QModelIndex &theIndex, int theRole) const;
+ QVariant data(const QModelIndex &theIndex, int theRole) const override;
/// Returns the data for the given role and section in the header with the
/// specified orientation. \param theSection a section \param theOrient an
/// orientation \param theRole a data role (see Qt::ItemDataRole)
- virtual QVariant headerData(int theSection, Qt::Orientation theOrient,
- int theRole = Qt::DisplayRole) const;
+ QVariant headerData(int theSection, Qt::Orientation theOrient,
+ int theRole = Qt::DisplayRole) const override;
/// Returns the number of rows under the given parent. When the parent is
/// valid it means that rowCount is returning the number of children of
/// parent. \param theParent a parent model index
- virtual int rowCount(const QModelIndex &theParent = QModelIndex()) const;
+ int rowCount(const QModelIndex &theParent = QModelIndex()) const override;
/// Returns the number of columns for the children of the given parent.
/// It has a one column
/// \param theParent a parent model index
- virtual int columnCount(const QModelIndex &theParent = QModelIndex()) const;
+ int columnCount(const QModelIndex &theParent = QModelIndex()) const override;
/// Returns the index of the item in the model specified by the given row,
/// column and parent index.
/// \param theRow a row
/// \param theColumn a column
/// \param theParent a parent model index
- virtual QModelIndex index(int theRow, int theColumn,
- const QModelIndex &theParent = QModelIndex()) const;
+ QModelIndex
+ index(int theRow, int theColumn,
+ const QModelIndex &theParent = QModelIndex()) const override;
/// Returns the parent of the model item with the given index.
/// If the item has no parent, an invalid QModelIndex is returned.
/// \param theIndex a model index
- virtual QModelIndex parent(const QModelIndex &theIndex) const;
+ QModelIndex parent(const QModelIndex &theIndex) const override;
/// Returns true if parent has any children; otherwise returns false.
/// \param theParent a parent model index
- virtual bool hasChildren(const QModelIndex &theParent = QModelIndex()) const;
+ bool hasChildren(const QModelIndex &theParent = QModelIndex()) const override;
/// Inserts count rows into the model before the given row.
/// Items in the new row will be children of the item represented by the
/// parent model index. \param theRow a start row \param theCount a nember of
/// rows to insert \param theParent a parent model index
- virtual bool insertRows(int theRow, int theCount,
- const QModelIndex &theParent = QModelIndex());
+ bool insertRows(int theRow, int theCount,
+ const QModelIndex &theParent = QModelIndex()) override;
/// Removes count rows starting with the given row under parent parent from
/// the model. \param theRow a start row \param theCount a nember of rows to
/// remove \param theParent a parent model index
- virtual bool removeRows(int theRow, int theCount,
- const QModelIndex &theParent = QModelIndex());
+ bool removeRows(int theRow, int theCount,
+ const QModelIndex &theParent = QModelIndex()) override;
/// Returns the item flags for the given index.
/// \param theIndex a model index
- virtual Qt::ItemFlags flags(const QModelIndex &theIndex) const;
+ Qt::ItemFlags flags(const QModelIndex &theIndex) const override;
/// Returns true if a model can accept a drop of the data (used for drag and
/// drop functionality).
- virtual bool canDropMimeData(const QMimeData *theData,
- Qt::DropAction theAction, int theRow,
- int theColumn,
- const QModelIndex &theParent) const override;
+ bool canDropMimeData(const QMimeData *theData, Qt::DropAction theAction,
+ int theRow, int theColumn,
+ const QModelIndex &theParent) const override;
/// Converts the dragged items information into mime data format (to be
/// encoded in dropMimeData)
- virtual QMimeData *mimeData(const QModelIndexList &indexes) const override;
+ QMimeData *mimeData(const QModelIndexList &indexes) const override;
/// Performs a drag and drop of Part feature operation when it is droped.
- virtual bool dropMimeData(const QMimeData *theData, Qt::DropAction theAction,
- int theRow, int theColumn,
- const QModelIndex &theParent) override;
+ bool dropMimeData(const QMimeData *theData, Qt::DropAction theAction,
+ int theRow, int theColumn,
+ const QModelIndex &theParent) override;
/// Returns an index which is root of the given document
/// \param theDoc a document
QModelIndex getIndex(ModuleBase_ITreeNode *theNode, int thCol) const;
/// Allows to support drag and drop of some model items
- virtual Qt::DropActions supportedDropActions() const override {
+ Qt::DropActions supportedDropActions() const override {
return Qt::MoveAction;
}
: QDialog(theParent,
Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint) {
setWindowTitle(tr("Deflection"));
- QGridLayout *aLay = new QGridLayout(this);
+ auto *aLay = new QGridLayout(this);
myDeflection = new ModuleBase_DoubleSpinBox(this);
myDeflection->setDecimals(12);
myDeflection->setSingleStep(0.001);
aLay->addWidget(myDeflection, 0, 0);
- QDialogButtonBox *aButtons = new QDialogButtonBox(
+ auto *aButtons = new QDialogButtonBox(
QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
connect(aButtons, SIGNAL(accepted()), this, SLOT(accept()));
connect(aButtons, SIGNAL(rejected()), this, SLOT(reject()));
/// \param theParent a parent widget for the dialog
XGUI_EXPORT XGUI_DeflectionDialog(QWidget *theParent);
- XGUI_EXPORT virtual ~XGUI_DeflectionDialog(){};
+ XGUI_EXPORT ~XGUI_DeflectionDialog() override = default;
+ ;
/// Initializes the dialog with the given value.
/// \param theValue the deflection value
constexpr int DEFAULT_DISPLAY_PRIORITY =
5; /* = Graphic3d_DisplayPriority_Normal */
-//#define DEBUG_DISPLAY
-//#define DEBUG_FEATURE_REDISPLAY
-//#define DEBUG_SELECTION_FILTERS
+// #define DEBUG_DISPLAY
+// #define DEBUG_FEATURE_REDISPLAY
+// #define DEBUG_SELECTION_FILTERS
-//#define DEBUG_OCCT_SHAPE_SELECTION
+// #define DEBUG_OCCT_SHAPE_SELECTION
#define CLEAR_OUTDATED_SELECTION_BEFORE_REDISPLAY
-//#define DEBUG_VIEWER_BLOCKED_COUNT
+// #define DEBUG_VIEWER_BLOCKED_COUNT
//**************************************************************
void displayedObjects(const Handle(AIS_InteractiveContext) & theAIS,
}
// myWorkshop->module()->storeSelection();
- //#ifdef CLEAR_OUTDATED_SELECTION_BEFORE_REDISPLAY
- // myWorkshop->selector()->deselectPresentation(aAISIO);
- //#endif
+ // #ifdef CLEAR_OUTDATED_SELECTION_BEFORE_REDISPLAY
+ // myWorkshop->selector()->deselectPresentation(aAISIO);
+ // #endif
if (aContext->IsDisplayed(aAISIO))
aContext->Redisplay(aAISIO, false);
XGUI_Displayer(XGUI_Workshop *theWorkshop);
/// Destructor
- virtual ~XGUI_Displayer();
+ ~XGUI_Displayer() override;
/// Returns the feature visibility state.
/// \param theObject an object instance
const QString INVALID_VALUE = "invalid_action";
-//#define DEBUG_ERROR_STATE
+// #define DEBUG_ERROR_STATE
XGUI_ErrorMgr::XGUI_ErrorMgr(QObject *theParent,
ModuleBase_IWorkshop *theWorkshop)
/// \param theWorkshop a workshop
XGUI_ModuleConnector(XGUI_Workshop *theWorkshop);
- virtual ~XGUI_ModuleConnector();
+ ~XGUI_ModuleConnector() override;
//! Returns list of currently selected data objects
- virtual ModuleBase_ISelection *selection() const;
+ ModuleBase_ISelection *selection() const override;
//! Returns instance of loaded module
- virtual ModuleBase_IModule *module() const;
+ ModuleBase_IModule *module() const override;
//! Returns current viewer
- virtual ModuleBase_IViewer *viewer() const;
+ ModuleBase_IViewer *viewer() const override;
//! Returns property panel
- virtual ModuleBase_IPropertyPanel *propertyPanel() const;
+ ModuleBase_IPropertyPanel *propertyPanel() const override;
//! Returns error manager
- virtual ModuleBase_IErrorMgr *errorMgr() const;
+ ModuleBase_IErrorMgr *errorMgr() const override;
/// A selection activate in 3D View handler
- virtual ModuleBase_ISelectionActivate *selectionActivate() const;
+ ModuleBase_ISelectionActivate *selectionActivate() const override;
//! Returns currently active operation
- virtual ModuleBase_Operation *currentOperation() const;
+ ModuleBase_Operation *currentOperation() const override;
//! Returns true if the operation with id theId can be started
/// \param theId id of the operation which is going to start
/// \param isCommitted boolean value if the operation was committed otherwise
/// it was aborted
- virtual bool canStartOperation(QString theId, bool &isCommitted);
+ bool canStartOperation(QString theId, bool &isCommitted) override;
//! Performs the operation launch
//! \param theOperation an operation to be launched
- virtual void processLaunchOperation(ModuleBase_Operation *theOperation);
+ void processLaunchOperation(ModuleBase_Operation *theOperation) override;
//! Returns started operation by the operation identifier. The operation
//! manager is called. \param theId an operation id \return an operation
//! instance or NULL
- virtual ModuleBase_Operation *findStartedOperation(const QString &theId);
+ ModuleBase_Operation *findStartedOperation(const QString &theId) override;
//! Returns true if the operation with id theId can be stopped. The operation
//! manager is called. \param theOperation a stopped operation \return boolean
//! result
- virtual bool canStopOperation(ModuleBase_Operation *theOperation);
+ bool canStopOperation(ModuleBase_Operation *theOperation) override;
//! Commits if possible or aborts the given operation.
//! \param theOperation an aborted operation
/// \param isCommitted boolean value if the operation was committed otherwise
/// it was aborted
- virtual void stopOperation(ModuleBase_Operation *theOperation,
- bool &isCommitted);
+ void stopOperation(ModuleBase_Operation *theOperation,
+ bool &isCommitted) override;
//! Returns AIS object by data object
- virtual AISObjectPtr findPresentation(const ObjectPtr &theObject) const;
+ AISObjectPtr findPresentation(const ObjectPtr &theObject) const override;
//! Returns data object by AIS
- virtual ObjectPtr findPresentedObject(const AISObjectPtr &theAIS) const;
+ ObjectPtr findPresentedObject(const AISObjectPtr &theAIS) const override;
//! Returns true if the object is displayed
//! \param theObject a data object
- virtual bool isVisible(const ObjectPtr &theObject) const;
+ bool isVisible(const ObjectPtr &theObject) const override;
//! Returns list of currently displayed objects
- virtual QObjectPtrList displayedObjects() const;
+ QObjectPtrList displayedObjects() const override;
//! Select features clearing previous selection.
//! If the list is empty then selection will be cleared
- virtual void
- setSelected(const QList<std::shared_ptr<ModuleBase_ViewerPrs>> &theValues);
+ void setSelected(
+ const QList<std::shared_ptr<ModuleBase_ViewerPrs>> &theValues) override;
//! Shows the message in the status bar
//! \param theMessage a message
- virtual void setStatusBarMessage(const QString &theMessage);
+ void setStatusBarMessage(const QString &theMessage) override;
/// Update of commands status
- virtual void updateCommandStatus();
+ void updateCommandStatus() override;
/// Returns Information about feature defined in corresponded XML
/// \param theId - id of the feature
- virtual std::shared_ptr<Config_FeatureMessage>
- featureInfo(const QString &theId) const;
+ std::shared_ptr<Config_FeatureMessage>
+ featureInfo(const QString &theId) const override;
/// Return application main window
- virtual QMainWindow *desktop() const;
+ QMainWindow *desktop() const override;
/// Returns true if SHIFT is pressed
/// \return boolean value
- virtual bool hasSHIFTPressed() const;
+ bool hasSHIFTPressed() const override;
- virtual void deactivateCurrentSelector();
+ void deactivateCurrentSelector() override;
//! Temporary enable or disable viewer update. Returns previous state of
//! updating \param isEnabled new state of the viewer update
- virtual bool enableUpdateViewer(bool isEnabled);
+ bool enableUpdateViewer(bool isEnabled) override;
//! Returns workshop
XGUI_Workshop *workshop() const { return myWorkshop; }
//! presentation. The AIS presentation has to be already displayed. After
//! activation viewer has to be updated \param theAIS the object which has to
//! be activated
- virtual void applyCurrentSelectionModes(const AISObjectPtr &theAIS);
+ void applyCurrentSelectionModes(const AISObjectPtr &theAIS) override;
//! Undo last command
- virtual void undo();
+ void undo() override;
//! Set enabled state of cancel button in property panel
- virtual void setCancelEnabled(bool toEnable);
+ void setCancelEnabled(bool toEnable) override;
//! Returns current state of cancel button
- virtual bool isCancelEnabled() const;
+ bool isCancelEnabled() const override;
//! Show help of a current operation
- virtual void showHelpPage(const QString &thePage) const;
+ void showHelpPage(const QString &thePage) const override;
private:
QObjectPtrList activeObjects(const QObjectPtrList &theObjList) const;
class XGUI_Workshop;
class ModuleBase_ITreeNode;
-//#define DEBUG_INDXES
+// #define DEBUG_INDXES
/**
* \ingroup GUI
protected:
/// On mouse release
- virtual void mouseReleaseEvent(QMouseEvent *e);
+ void mouseReleaseEvent(QMouseEvent *e) override;
/// Filter event
- bool eventFilter(QObject *theObj, QEvent *theEvent);
+ bool eventFilter(QObject *theObj, QEvent *theEvent) override;
private:
QString myPreSelectionStyle;
/// \param theParent a parent widget
XGUI_DataTree(QWidget *theParent);
- virtual ~XGUI_DataTree();
+ ~XGUI_DataTree() override;
/// Returns current data model
XGUI_DataModel *dataModel() const;
protected slots:
/// Commit modified data (used for renaming of objects)
- virtual void commitData(QWidget *theEditor);
+ void commitData(QWidget *theEditor) override;
/// A slot which is called on mouse double click
void onDoubleClick(const QModelIndex &);
protected:
/// Redefinition of virtual method
- virtual void contextMenuEvent(QContextMenuEvent *theEvent);
+ void contextMenuEvent(QContextMenuEvent *theEvent) override;
/// Redefinition of virtual method
- virtual void resizeEvent(QResizeEvent *theEvent);
+ void resizeEvent(QResizeEvent *theEvent) override;
/// Redefinition of virtual method
- virtual void mouseReleaseEvent(QMouseEvent *theEvent);
+ void mouseReleaseEvent(QMouseEvent *theEvent) override;
#ifdef DEBUG_INDXES
virtual void mousePressEvent(QMouseEvent *theEvent);
/// Constructor
/// \param theParent a parent widget
XGUI_ObjectsBrowser(QWidget *theParent, XGUI_Workshop *theWorkshop);
- virtual ~XGUI_ObjectsBrowser();
+ ~XGUI_ObjectsBrowser() override;
//! Returns Model which provides access to data objects
XGUI_DataModel *dataModel() const { return myDocModel; }
//! Returns list of currently selected objects
//! \param theIndexes - output list of corresponded indexes (can be NULL)
- QObjectPtrList selectedObjects(QModelIndexList *theIndexes = 0) const;
+ QObjectPtrList selectedObjects(QModelIndexList *theIndexes = nullptr) const;
/// Set selected list of objects
/// \param theObjects list of objects to select
protected:
//! redefinition of a virtual method
- void resizeEvent(QResizeEvent *theEvent);
+ void resizeEvent(QResizeEvent *theEvent) override;
private slots:
/// Show context menu
#include <QMessageBox>
#include <QWindow>
-//#define DEBUG_CURRENT_FEATURE
+// #define DEBUG_CURRENT_FEATURE
/// Processes "Delete" key event of application. This key is used by several
/// application actions. There is a logical order of the actions processing. So
XGUI_OperationMgr(QObject *theParent, ModuleBase_IWorkshop *theWorkshop);
/// Destructor
- virtual ~XGUI_OperationMgr();
+ ~XGUI_OperationMgr() override;
/// Switch on short cut listener
void activate();
/// Emits nestedStateChange for operations with an information about validity
/// of the operation \param theOperation the sent operation. If it is NULL,
/// all operations in the stack are sent.
- void updateApplyOfOperations(ModuleBase_Operation *theOperation = 0);
+ void updateApplyOfOperations(ModuleBase_Operation *theOperation = nullptr);
protected: // TEMPORARY
/// Sets the current operation or NULL
static QMessageBox *createInformationBox(const QString &theMessage);
private:
- typedef QList<ModuleBase_Operation *>
- Operations; ///< definition for a list of operations
+ using Operations =
+ QList<ModuleBase_Operation *>; ///< definition for a list of operations
Operations myOperations; ///< a stack of started operations. The active
///< operation is on top,
// others are suspended and started by the active is
#include <XGUI_Tools.h>
#include <XGUI_Workshop.h>
-//#include <AppElements_Constants.h>
+// #include <AppElements_Constants.h>
#include <ModuleBase_Events.h>
#include <ModuleBase_IModule.h>
#include <ModuleBase_IWorkshop.h>
#include <iostream>
#endif
-//#define DEBUG_TAB_WIDGETS
+// #define DEBUG_TAB_WIDGETS
-//#define DEBUG_ACTIVE_WIDGET
+// #define DEBUG_ACTIVE_WIDGET
XGUI_PropertyPanel::XGUI_PropertyPanel(QWidget *theParent,
XGUI_OperationMgr *theMgr)
#include <SelectMgr_SelectionManager.hxx>
-//#define DEBUG_ACTIVATE_OBJECTS
-//#define DEBUG_DEACTIVATE
-//#define DEBUG_ACTIVATE_AIS
-//#define DEBUG_DEACTIVATE_AIS
+// #define DEBUG_ACTIVATE_OBJECTS
+// #define DEBUG_DEACTIVATE
+// #define DEBUG_ACTIVATE_AIS
+// #define DEBUG_DEACTIVATE_AIS
#ifdef TINSPECTOR
#include <inspector/VInspectorAPI_CallBack.hxx>
XGUI_EXPORT XGUI_SelectionActivate(ModuleBase_IWorkshop *theWorkshop);
/// Destructor
- ~XGUI_SelectionActivate() {}
+ ~XGUI_SelectionActivate() override = default;
/// Returns place of activation modes that now is active
/// \return place
/// Updates active selection modes in the viewer depending on the application
/// state
- XGUI_EXPORT virtual void updateSelectionModes();
+ XGUI_EXPORT void updateSelectionModes() override;
/// Updates active selection filters in the viewer depending on the
/// application state
- XGUI_EXPORT virtual void updateSelectionFilters();
+ XGUI_EXPORT void updateSelectionFilters() override;
/// Activates parameter filters in the workshop, deactivate active out of the
/// container Please find a possibility to use updateSelectionFilters instead
/// of direct call this method. \param theSelectionFilters a filtes
- XGUI_EXPORT virtual void
- activateSelectionFilters(const SelectMgr_ListOfFilter &theSelectionFilters);
+ XGUI_EXPORT void activateSelectionFilters(
+ const SelectMgr_ListOfFilter &theSelectionFilters) override;
/// Returns list of currently active selection modes
/// Selection modes will be returned according to TopAbs_ShapeEnum
/// Constructor
/// \param theParent a parent workshop
XGUI_SelectionMgr(XGUI_Workshop *theParent);
- virtual ~XGUI_SelectionMgr();
+ ~XGUI_SelectionMgr() override;
/// Returns current selection
XGUI_Selection *selection() const { return mySelection; }
void connectViewProxy();
//! Returns AIS_InteractiveContext from current OCCViewer
- virtual Handle(AIS_InteractiveContext) AISContext() const;
+ Handle(AIS_InteractiveContext) AISContext() const override;
//! Trihedron 3d object shown in the viewer
- virtual Handle(AIS_Trihedron) trihedron() const;
+ Handle(AIS_Trihedron) trihedron() const override;
//! Retrurns V3d_Vioewer from current viewer
- virtual Handle(V3d_Viewer) v3dViewer() const;
+ Handle(V3d_Viewer) v3dViewer() const override;
//! Returns Vsd_View object from currently active view window
- virtual Handle(V3d_View) activeView() const;
+ Handle(V3d_View) activeView() const override;
- virtual QWidget *activeViewPort() const;
+ QWidget *activeViewPort() const override;
//! Enable or disable selection in the viewer
- virtual void enableSelection(bool isEnabled);
+ void enableSelection(bool isEnabled) override;
//! Returns true if selection is enabled
- virtual bool isSelectionEnabled() const;
+ bool isSelectionEnabled() const override;
//! Enable or disable multiselection in the viewer
- virtual void enableMultiselection(bool isEnable);
+ void enableMultiselection(bool isEnable) override;
//! Returns true if multiselection is enabled
- virtual bool isMultiSelectionEnabled() const;
+ bool isMultiSelectionEnabled() const override;
//! Enable or disable draw mode in the viewer
- virtual bool enableDrawMode(bool isEnabled);
+ bool enableDrawMode(bool isEnabled) override;
//! Sets the view projection
/// \param theX the X projection value
/// \param theY the Y projection value
/// \param theZ the Z projection value
/// \param theTwist the twist angle in radians
- virtual void setViewProjection(double theX, double theY, double theZ,
- double theTwist);
+ void setViewProjection(double theX, double theY, double theZ,
+ double theTwist) override;
//! Sets the view fitted all
- virtual void fitAll();
+ void fitAll() override;
//! Erases all presentations from the viewer
- virtual void eraseAll();
+ void eraseAll() override;
/// Connects to a viewer according to current environment
void connectToViewer();
/// Add selection filter to the viewer
- virtual void addSelectionFilter(const Handle(SelectMgr_Filter) & theFilter);
+ void addSelectionFilter(const Handle(SelectMgr_Filter) & theFilter) override;
/// Remove selection filter from the viewer
- virtual void removeSelectionFilter(const Handle(SelectMgr_Filter) &
- theFilter);
+ void removeSelectionFilter(const Handle(SelectMgr_Filter) &
+ theFilter) override;
/// Returns true if the selection filter is set to the viewer
/// \param theFilter a selection filter
- virtual bool hasSelectionFilter(const Handle(SelectMgr_Filter) & theFilter);
+ bool hasSelectionFilter(const Handle(SelectMgr_Filter) & theFilter) override;
/// Remove all selection filters from the viewer
virtual void clearSelectionFilters();
/// Update current viewer
- virtual void update();
+ void update() override;
/// Method returns True if the viewer can process editing objects
/// by mouse drugging. If this is impossible thet it has to return False.
- virtual bool canDragByMouse() const;
+ bool canDragByMouse() const override;
- virtual void updateHighlight();
+ void updateHighlight() override;
// Methods for color scale management
//! Returns True if ColorScale is visible
- virtual bool isColorScaleVisible() const;
+ bool isColorScaleVisible() const override;
//! Show/Hide ColorScale object
- virtual void setColorScaleShown(bool on);
+ void setColorScaleShown(bool on) override;
//! Set position of color scale
// \param theX is X position relative to current view width
// \param theY is Y position relative to current view heigth
- virtual void setColorScalePosition(double theX, double theY);
+ void setColorScalePosition(double theX, double theY) override;
//! Set size of color scale
// \param theW is width relative to current view width
// \param theh is height relative to current view heigth
- virtual void setColorScaleSize(double theW, double theH);
+ void setColorScaleSize(double theW, double theH) override;
//! Set range of color scale
// \param theMin is a minimal value
// \param theMax is a maximal value
- virtual void setColorScaleRange(double theMin, double theMax);
+ void setColorScaleRange(double theMin, double theMax) override;
//! Set number of intervals of color scale
// \param theNb is number of intervals
- virtual void setColorScaleIntervals(int theNb);
+ void setColorScaleIntervals(int theNb) override;
//! Set text heigth of color scale
// \param theH is number of intervals
- virtual void setColorScaleTextHeigth(int theH);
+ void setColorScaleTextHeigth(int theH) override;
//! Set color of text of color scale
// \param theH is number of intervals
- virtual void setColorScaleTextColor(const QColor &theColor);
+ void setColorScaleTextColor(const QColor &theColor) override;
//! Set title of color scale
// \param theText is a title
- virtual void setColorScaleTitle(const QString &theText);
+ void setColorScaleTitle(const QString &theText) override;
//! Set color scale parameters according to user preferences and window size
void setupColorScale();
//! \param theText the text to display, or empty string to erase presentation;
//! the first item is the font name and text color
//! \param theSize size of the text font
- virtual void setText(const ModuleBase_IViewer::TextColor &theText,
- const int theSize);
+ void setText(const ModuleBase_IViewer::TextColor &theText,
+ const int theSize) override;
// Fit all along Z (perpendicular to display)
// virtual void Zfitall();
#ifdef HAVE_SALOME
- virtual void setFitter(OCCViewer_Fitter *theFitter);
- virtual OCCViewer_Fitter *fitter() const;
+ void setFitter(OCCViewer_Fitter *theFitter) override;
+ OCCViewer_Fitter *fitter() const override;
#else
virtual void setFitter(AppElements_Fitter *theFitter);
virtual AppElements_Fitter *fitter() const;
protected:
/// processes the application signals to catch the mouse leaving state of the
/// main window \param theObject \param theEvent
- bool eventFilter(QObject *theObject, QEvent *theEvent);
+ bool eventFilter(QObject *theObject, QEvent *theEvent) override;
private slots:
void onViewCreated(ModuleBase_IViewWindow *theWnd);
#include <ModelAPI_Validator.h>
#include <ModuleBase_IconFactory.h>
-//#include <PartSetPlugin_Part.h>
+// #include <PartSetPlugin_Part.h>
#include <Events_InfoMessage.h>
#include <Events_LongOp.h>
#include <dlfcn.h>
#endif
-//#define DEBUG_WITH_MESSAGE_REPORT
+// #define DEBUG_WITH_MESSAGE_REPORT
QString XGUI_Workshop::MOVE_TO_END_COMMAND = QObject::tr("Move to the end");
QString XGUI_Workshop::MOVE_TO_END_SPLIT_COMMAND =
QObject::tr("Move to the end and split");
-//#define DEBUG_DELETE
-//#define DEBUG_FEATURE_NAME
-//#define DEBUG_CLEAN_HISTORY
+// #define DEBUG_DELETE
+// #define DEBUG_FEATURE_NAME
+// #define DEBUG_CLEAN_HISTORY
#ifdef HAVE_SALOME
static QString MyFilter(QObject::tr("SHAPER files (*.shaper *.cadbld)"));
const QChar aSep = QDir::separator();
// QString platform;
// SUIT_ResourceMgr* aResMgr = ModuleBase_Preferences::resourceMgr();
- //#ifdef WIN32
+ // #ifdef WIN32
// platform = "winapplication";
- //#else
+ // #else
// platform = "application";
- //#endif
+ // #endif
// QString aBrowserName = aResMgr->stringValue("ExternalBrowser",
// platform);
/// Constructor
/// \param theConnector a Salome connector object.
/// Used only if the workshop is launched in Salome environment
- XGUI_Workshop(XGUI_SalomeConnector *theConnector = 0);
- virtual ~XGUI_Workshop();
+ XGUI_Workshop(XGUI_SalomeConnector *theConnector = nullptr);
+ ~XGUI_Workshop() override;
/// Starting of the application
void startApplication();
ModuleBase_IViewer *salomeViewer() const;
/// Returns true if the application works as SALOME module
- bool isSalomeMode() const { return mySalomeConnector != 0; }
+ bool isSalomeMode() const { return mySalomeConnector != nullptr; }
/// Returns Object browser
XGUI_ObjectsBrowser *objectBrowser() const { return myObjectBrowser; }
disable : 4189) // for declaration of unused variables (MAYBE_UNUSED)
#endif
-//#define DEBUG_FEATURE_CREATED
-//#define DEBUG_FEATURE_REDISPLAY
-//#define DEBUG_FEATURE_UPDATED
-//#define DEBUG_RESULT_COMPSOLID
+// #define DEBUG_FEATURE_CREATED
+// #define DEBUG_FEATURE_REDISPLAY
+// #define DEBUG_FEATURE_UPDATED
+// #define DEBUG_RESULT_COMPSOLID
#ifdef DEBUG_FEATURE_REDISPLAY
const std::string DebugFeatureKind = ""; //"Extrusion";
# Boucle de répétition des tubes autour de la sphère :
# =============================================================================
i = 1
-CutTools = (
- []
-) # liste pour accumulation des tubes int. et cut de la sphère ext. par tous ces tubes int.
+CutTools = [] # liste pour accumulation des tubes int. et cut de la sphère ext. par tous ces tubes int.
IntTools = [
Sphere_ext.result()
] # liste pour accumulation de la sphère ext. et de tous les tubes ext. et calcul d'intersection entre tous ces objets (pour déterminer les arêtes sur lesquelles on mettra des fillets).