/// unique shape, remove compound on type
TopoDS_Iterator anIt(aShape);
- TopoDS_Shape aShape = anIt.Value();
std::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
- aRes->setImpl(new TopoDS_Shape(aShape));
+ aRes->setImpl(new TopoDS_Shape(anIt.Value()));
aGroup->store(GeomShapePtr());
aGroup->store(aRes);
aCompound = aGroup->shape();
AttributeIntegerPtr& aTargetAttr);
};
-EXCHANGEPLUGIN_EXPORT class ExchangePlugin_Import : public ExchangePlugin_ImportBase
+class ExchangePlugin_Import : public ExchangePlugin_ImportBase
{
public:
/// Feature kind
};
-EXCHANGEPLUGIN_EXPORT class ExchangePlugin_Import_Image : public ExchangePlugin_ImportBase
+class ExchangePlugin_Import_Image : public ExchangePlugin_ImportBase
{
public:
/// Feature kind
if (aRes->get() && ((*aRes)->data()->name() == (*aResMat)))
{
if (aShape->isCompound() || aShape->isCompSolid()) {
- GeomAPI_ShapeIterator anIt(aShape);
- for (; anIt.more(); anIt.next()) {
- aSelectionList->setSelectionType(anIt.current()->shapeTypeStr());
- aSelectionList->append(theResultBody,anIt.current());
+ GeomAPI_ShapeIterator aShapeIt(aShape);
+ for (; aShapeIt.more(); aShapeIt.next()) {
+ aSelectionList->setSelectionType(aShapeIt.current()->shapeTypeStr());
+ aSelectionList->append(theResultBody, aShapeIt.current());
}
} else {
aSelectionList->setSelectionType(aShape->shapeTypeStr());
}
//=================================================================================================
-void FeaturesPlugin_NormalToFace::attributeChanged(const std::string& theID)
+void FeaturesPlugin_NormalToFace::attributeChanged(const std::string& /*theID*/)
{
}
.. _transformation_subshapes:
-Transformation of COMPSOLID subshapes is prohibited. Read more about transformation of COMPOUND subshapes.
-======================
+Transformation of COMPSOLID subshapes is prohibited.
+===========
-If you select one or more subshapes of COMPOUND as transformation **Main objects**, all other subshapes will be also included in result at their original locations.
+If you select one or more subshapes of COMPOUND as transformation (translation or other operation that changes the shape position or orientation) **Main objects**,
+all other subshapes will be also included in result at their original locations.
Transformation of COMPSOLID subshapes is prohibited, because we cannot guarantee the result still be a COMPSOLID after moving/duplicating some parts of it.
else {
//cout<<"need re-scale a model"<<endl;
// set UnitFlag to 'meter'
- Interface_Static::SetCVal("xstep.cascade.unit","M");
+ Interface_Static::SetCVal("xstep.cascade.unit", "M");
}
return true;
}
//==================================================================================================
std::shared_ptr<GeomAPI_Shape> STEPImport(const std::string& theFileName,
- const std::string& theFormatName,
+ const std::string& /*theFormatName*/,
const bool theScalInterUnits,
std::string& theError)
{
STEPControl_Reader aReader;
//VSR: 16/09/09: Convert to METERS
- Interface_Static::SetCVal("xstep.cascade.unit","M");
+ Interface_Static::SetCVal("xstep.cascade.unit", "M");
Interface_Static::SetIVal("read.step.ideas", 1);
Interface_Static::SetIVal("read.step.nonmanifold", 1);
if (status == IFSelect_RetDone) {
// Regard or not the model units
- if( !readUnits(aReader,theScalInterUnits,theError)) {
+ if( !readUnits(aReader, theScalInterUnits, theError)) {
std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
aGeomShape->setImpl(new TopoDS_Shape());
return aGeomShape;
aResShape = compound;
// Check if any BRep entity has been read, there must be at least a vertex
- if ( !TopExp_Explorer( aResShape, TopAbs_VERTEX ).More() )
+ if (!TopExp_Explorer(aResShape, TopAbs_VERTEX).More())
{
theError = "No geometrical data in the imported file.";
std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
std::shared_ptr<ModelAPI_ResultBody> theResultBody,
const bool theScalInterUnits,
const bool theMaterials,
- const bool theColor,
+ const bool /*theColor*/,
std::map< std::wstring,
std::list<std::wstring>>& theMaterialShape,
std::string& theError)
STEPControl_Reader aReader;
std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
- Interface_Static::SetCVal("xstep.cascade.unit","M");
+ Interface_Static::SetCVal("xstep.cascade.unit", "M");
Interface_Static::SetIVal("read.step.ideas", 1);
Interface_Static::SetIVal("read.step.nonmanifold", 1);
if (status == IFSelect_RetDone) {
// Regard or not the model units
- if( !readUnits(aReader,theScalInterUnits,theError)) {
+ if( !readUnits(aReader, theScalInterUnits, theError)) {
aGeomShape->setImpl(new TopoDS_Shape());
return aGeomShape;
}
if (aCafreader.ReadFile(theFileName.c_str()) != IFSelect_RetDone) {
theError = "Wrong format of the imported file. Can't import file.";
- std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
aGeomShape->setImpl(new TopoDS_Shape());
return aGeomShape;
}
theMaterials,
theMaterialShape,
theError);
- } catch (OSD_Exception& e) {
+ } catch (OSD_Exception&) {
//Try to load STEP file without colors...
- return STEPImport(theFileName,"",theScalInterUnits,theError);
+ return STEPImport(theFileName, "", theScalInterUnits, theError);
}
}
//=============================================================================
std::shared_ptr<GeomAPI_Shape> setgeom(const Handle(XCAFDoc_ShapeTool) &theShapeTool,
- const TDF_Label &theLabel,
+ const TDF_Label& /*theLabel*/,
std::string& theError)
{
BRep_Builder aB;
// Check if any BRep entity has been read, there must be at least a vertex
if (!TopExp_Explorer( aShape, TopAbs_VERTEX ).More()) {
theError = "No geometrical data in the imported file.";
- std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
aGeomShape->setImpl(new TopoDS_Shape());
return aGeomShape;
}
const Handle(Standard_Transient) &theEnti,
const TopTools_IndexedMapOfShape &theIndices,
const Handle(Transfer_TransientProcess) &theTP,
- const TDF_Label &theShapeLabel,
+ const TDF_Label &/*theShapeLabel*/,
std::map< std::wstring, std::list<std::wstring>> &theMaterialShape )
{
// Treat Product Definition Shape only.
{
OSD_Path aPath (theFileName.c_str());
Standard_Integer aTrekLen =
- theFileName.size() - aPath.Extension().Length() - aPath.Name().Length();
+ int(theFileName.size()) - aPath.Extension().Length() - aPath.Name().Length();
return theFileName.substr(0, aTrekLen);
}
if (theWidth > 0 && theHeight > 0 && theByteArray.size() > 0) { // set new data
// Find or create attributes
Handle_TDataStd_ByteArray aByteArray =
- TDataStd_ByteArray::Set(myLab, 0, theByteArray.size() - 1);
+ TDataStd_ByteArray::Set(myLab, 0, int(theByteArray.size()) - 1);
Handle_TDataStd_IntegerArray aDimensions =
TDataStd_IntegerArray::Set(myLab, 0, 1);
Handle_TDataStd_Comment aFormat = TDataStd_Comment::Set(myLab, theFormat.c_str());
// Texture
Handle(TColStd_HArray1OfByte) aNewArray =
- new TColStd_HArray1OfByte(0, theByteArray.size() - 1);
+ new TColStd_HArray1OfByte(0, int(theByteArray.size()) - 1);
std::list<unsigned char>::const_iterator itBA = theByteArray.begin();
for (int j = 0; itBA != theByteArray.end(); ++itBA, ++j) {
aNewArray->SetValue(j, (Standard_Byte)(*itBA));
*/
MODELAPI_EXPORT std::string getFeatureError(const std::shared_ptr<ModelAPI_Feature>& theFeature);
-MODELAPI_EXPORT struct ResultBaseAlgo {
+struct ResultBaseAlgo {
std::shared_ptr<ModelAPI_ResultBody> resultBody;
std::shared_ptr<GeomAPI_Shape> baseShape;
std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape;
#include <QDialogButtonBox>
#include <QPushButton>
+#ifdef WIN32
+#pragma warning(disable : 4456) // for nested foreach
+#endif
+
const QString ModuleBase_Preferences::VIEWER_SECTION = "Viewer";
const QString ModuleBase_Preferences::MENU_SECTION = "Menu";
const QString ModuleBase_Preferences::GENERAL_SECTION = "General";
/// visualizes it in Ring style) OCCT version is 7.0.0 with path for SHAPER module.
Handle(StdSelect_BRepOwner) aOwner = new StdSelect_BRepOwner(aShape, aPriority, Standard_True);
StdSelect_BRepSelectionTool::ComputeSensitive(aShape, aOwner, aSelection,
- aDeflection, myDrawer->HLRAngle(), 9, 500);
+ aDeflection, myDrawer->DeviationAngle(), 9, 500);
NCollection_Vector<Handle(SelectMgr_SensitiveEntity)> anEntities = aSelection->Entities();
#include <ModelAPI_Folder.h>
#include <ModelGeomAlgo_Point2D.h>
+#include <SUIT_ResourceMgr.h>
#ifdef HAVE_SALOME
#include <SUIT_Application.h>
-#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#endif
#include <QCheckBox>
#include <QDir>
+#ifdef WIN32
+#pragma warning(disable : 4456) // for nested foreach
+#endif
+
FeaturePtr ModuleBase_WidgetSelectionFilter::SelectorFeature;
std::string ModuleBase_WidgetSelectionFilter::AttributeId;
#include <QShortcut>
#include <QFileDialog>
+#ifdef WIN32
+#pragma warning(disable : 4456) // for nested foreach
+#endif
+
enum ColumnType {
Col_Name,
Col_Equation,
#include <Geom_CartesianPoint.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
-#include <Prs3d_Root.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <AIS_InteractiveContext.hxx>
PtA->SetColor(theColor);
Handle(Geom_Point) aPnt = Component();
- Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(thePrs);
+ Handle(Graphic3d_Group) TheGroup = thePrs->CurrentGroup();
TheGroup->SetPrimitivesAspect(PtA);
Handle(Graphic3d_ArrayOfPoints) aPoint = new Graphic3d_ArrayOfPoints (1);
#include <XGUI_SelectionActivate.h>
#include <XGUI_SelectionMgr.h>
+#ifdef WIN32
+#pragma warning(disable : 4456) // for nested foreach
+#endif
+
PartSet_ExternalPointsMgr::PartSet_ExternalPointsMgr(ModuleBase_IWorkshop* theWorkshop,
const CompositeFeaturePtr& theSketch)
: QObject(theWorkshop), myWorkshop(theWorkshop), mySketch(theSketch)
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopExp_Explorer.hxx>
-#include <Prs3d_Root.hxx>
#include <Graphic3d_Text.hxx>
QStringList aValues = strings();
AttributeSelectionListPtr aSelList =
aData->selectionList(CollectionPlugin_Field::SELECTED_ID());
- Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
+ Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
for (int i = 0; i < aSelList->size(); i++) {
AttributeSelectionPtr aSelection = aSelList->value(i);
GeomShapePtr aShapePtr = aSelection->value();
Handle(V3d_Viewer) aV3dViewer = aContext->CurrentViewer();
Handle(V3d_View) aView;
double aScale = 0;
- for (aV3dViewer->InitDefinedViews();
- aV3dViewer->MoreDefinedViews();
- aV3dViewer->NextDefinedViews()) {
- Handle(V3d_View) aV = aV3dViewer->DefinedView();
+ V3d_ListOfView::Iterator aDefinedViews(aV3dViewer->DefinedViews());
+ for (; aDefinedViews.More(); aDefinedViews.Next()) {
+ Handle(V3d_View) aV = aDefinedViews.Value();
double aS = aV->Scale();
if (aS > aScale) {
aScale = aS;
{
if (!aPart.get() && aObj->groupName() == ModelAPI_ResultParameter::group())
{
- QObjectPtrList aObjects = aWorkshop->objectBrowser()->selectedObjects();
+ QObjectPtrList aSelectedObjects = aWorkshop->objectBrowser()->selectedObjects();
FeaturePtr aFeature;
ResultParameterPtr aParam;
- foreach(ObjectPtr aObj, aObjects) {
- aParam = std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aObj);
+ foreach(ObjectPtr aSelected, aSelectedObjects) {
+ aParam = std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aSelected);
if (aParam.get())
break;
}
theShape,
theTypeOfSelection,
aDeflection,
- myDrawer->HLRAngle(),
+ myDrawer->DeviationAngle(),
myDrawer->IsAutoTriangulation());
} catch ( Standard_Failure ) {
}
#include <QMessageBox>
#include <QMainWindow>
+#ifdef WIN32
+#pragma warning(disable : 4456) // for nested foreach
+#endif
+
#define DEBUG_UNDO_INVALID_SKETCH
#include <QDialog>
#include <QTimer>
+#ifdef WIN32
+#pragma warning(disable : 4456) // for nested foreach
+#endif
+
#ifndef DBL_MAX
#define DBL_MAX 1.7976931348623158e+308
#endif
theTubeAlgo->prepareNamingFaces();
// Insert to faces
- int num = 1;
std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
theTubeAlgo->getCreatedFaces();
for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it = listOfFaces.begin();
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Prs3d_PointAspect.hxx>
-#include <Prs3d_Root.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Select3D_SensitivePoint.hxx>
aPtA->SetScale(2. * aRatio);
aPtA->SetColor(aExternalColor);
- Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePresentation);
+ Handle(Graphic3d_Group) aGroup = thePresentation->CurrentGroup();
aGroup->SetPrimitivesAspect(aPtA);
Handle(Graphic3d_ArrayOfPoints) aPntArray = new Graphic3d_ArrayOfPoints(1);
aPntArray->AddVertex (myPoint.X(), myPoint.Y(), myPoint.Z());
#include <SketchPlugin_Constraint.h>
#include <Graphic3d_AspectLine3d.hxx>
-#include <Prs3d_Root.hxx>
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Collinear, SketcherPrs_SymbolPrs);
void SketcherPrs_Collinear::drawLines(const Handle(Prs3d_Presentation)& thePrs,
Quantity_Color theColor) const
{
- Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePrs);
+ Handle(Graphic3d_Group) aGroup = thePrs->CurrentGroup();
Handle(Graphic3d_AspectLine3d) aLineAspect =
new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
#include <SketchPlugin_Constraint.h>
#include <Graphic3d_AspectLine3d.hxx>
-#include <Prs3d_Root.hxx>
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs);
void SketcherPrs_HVDirection::drawLines(const Handle(Prs3d_Presentation)& thePrs,
Quantity_Color theColor) const
{
- Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePrs);
+ Handle(Graphic3d_Group) aGroup = thePrs->CurrentGroup();
// Draw constrained object
Handle(Graphic3d_AspectLine3d) aLineAspect =
#include <SketchPlugin_Constraint.h>
#include <Graphic3d_AspectLine3d.hxx>
-#include <Prs3d_Root.hxx>
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Middle, SketcherPrs_SymbolPrs);
void SketcherPrs_Middle::drawLines(const Handle(Prs3d_Presentation)& thePrs,
Quantity_Color theColor) const
{
- Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePrs);
+ Handle(Graphic3d_Group) aGroup = thePrs->CurrentGroup();
Handle(Graphic3d_AspectLine3d) aLineAspect =
new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
#include <SketchPlugin_Constraint.h>
#include <Graphic3d_AspectLine3d.hxx>
-#include <Prs3d_Root.hxx>
#include <Prs3d_LineAspect.hxx>
-
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Mirror, SketcherPrs_SymbolPrs);
static Handle(Image_AlienPixMap) MyPixMap;
if (aNb != anAttrC->size())
return;
- Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePrs);
+ Handle(Graphic3d_Group) aGroup = thePrs->CurrentGroup();
// drawListOfShapes uses myDrawer for attributes definition
Handle(Prs3d_LineAspect) aLnAspect = new Prs3d_LineAspect(theColor, Aspect_TOL_SOLID, 1);
#include <SketchPlugin_Constraint.h>
#include <Graphic3d_AspectLine3d.hxx>
-#include <Prs3d_Root.hxx>
-
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Parallel, SketcherPrs_SymbolPrs);
void SketcherPrs_Parallel::drawLines(const Handle(Prs3d_Presentation)& thePrs,
Quantity_Color theColor) const
{
- Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePrs);
+ Handle(Graphic3d_Group) aGroup = thePrs->CurrentGroup();
Handle(Graphic3d_AspectLine3d) aLineAspect =
new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
#include <ModuleBase_SelectionValidator.h>
#include <ModuleBase_Tools.h>
-
#include <QAction>
#include <QMainWindow>
+#ifdef WIN32
+#pragma warning(disable : 4456) // for nested foreach
+#endif
+
#ifdef _DEBUG
#include <iostream>
#include <QDebug>
#include <QMainWindow>
#include <QModelIndex>
+#ifdef WIN32
+#pragma warning(disable : 4456) // for nested foreach
+#endif
+
XGUI_ContextMenuMgr::XGUI_ContextMenuMgr(XGUI_Workshop* theParent)
: QObject(theParent),
myWorkshop(theParent),
Handle(AIS_InteractiveContext) aContext = AISContext();
if (!aContext.IsNull()) {
Handle(V3d_Viewer) aViewer = aContext->CurrentViewer();
- Handle(V3d_View) aView;
- for (aViewer->InitActiveViews(); aViewer->MoreActiveViews(); aViewer->NextActiveViews()) {
- aView = aViewer->ActiveView();
- break;
- }
+ Handle(V3d_View) aView = aViewer->ActiveViews().First();
if (!aView.IsNull()) {
double aEyeX, aEyeY, aEyeZ;
aView->Eye(aEyeX, aEyeY, aEyeZ);
Handle(AIS_InteractiveContext) aContext = AISContext();
if (!aContext.IsNull()) {
Handle(V3d_Viewer) aViewer = aContext->CurrentViewer();
- Handle(V3d_View) aView;
- for (aViewer->InitActiveViews(); aViewer->MoreActiveViews(); aViewer->NextActiveViews()) {
- aView = aViewer->ActiveView();
- break;
- }
+ Handle(V3d_View) aView = aViewer->ActiveViews().First();
return aView->Camera()->Scale();
}
return 1;
#include <QMainWindow>
#include <QTimer>
+#ifdef WIN32
+#pragma warning(disable : 4189) // for skipping MAYBE_UNUSED on Win
+#endif
+
static const int LayoutMargin = 3;
//********************************************************************
#include <set>
+#ifdef WIN32
+#pragma warning(disable : 4456) // for nested foreach
+#endif
+
#define DEBUG_DELIVERY
XGUI_Selection::XGUI_Selection(XGUI_Workshop* theWorkshop)
#include <inspector/VInspectorAPI_CallBack.hxx>
#endif
+#ifdef WIN32
+#pragma warning(disable : 4456) // for nested foreach
+#endif
+
#define OPTIMIZATION_LEVEL 50
#ifdef WIN32
#include <windows.h>
+#pragma warning(disable : 4456) // for nested foreach
+#pragma warning(disable : 4189) // for declaration of unused variables (MAYBE_UNUSED)
#else
#include <dlfcn.h>
#endif
#include <ModuleBase_Tools.h>
#include <ModuleBase_WidgetSelector.h>
-#ifdef HAVE_SALOME
#include <SUIT_Application.h>
#include <SUIT_Session.h>
-#endif
#include "XGUI_ActionsMgr.h"
#include "XGUI_Displayer.h"
#include <iostream>
#endif
+#ifdef WIN32
+#pragma warning(disable : 4189) // for declaration of unused variables (MAYBE_UNUSED)
+#endif
+
//#define DEBUG_FEATURE_CREATED
//#define DEBUG_FEATURE_REDISPLAY
//#define DEBUG_FEATURE_UPDATED
void XGUI_WorkshopListener::
onFeatureCreatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg)
{
- SUIT_Application * app = SUIT_Session::session()->activeApplication();
-
- QVariant aVar = app->property("IsLoadedScript");
+ bool isLoadedScript = false;
+ SUIT_Session* aSession = SUIT_Session::session();
+ if (aSession)
+ {
+ QVariant aVar = aSession->activeApplication()->property("IsLoadedScript");
+ isLoadedScript = !aVar.isNull() && aVar.toBool();
+ }
std::set<ObjectPtr> anObjects = theMsg->objects();
std::set<ObjectPtr>::const_iterator aIt;
//bool aHasPart = false;
bool aDisplayed = false;
- if (aVar.isNull() || !aVar.toBool()) {
+ if (!isLoadedScript) {
for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
ObjectPtr anObject = *aIt;