export TOOLS_DIR=$(pwd)
export HOME_OLD=$HOME
-source /dn46/SALOME/series8x/current-2017-07-11/start.sh
+source /dn46/SALOME/series8x/current-2018-03-02/start.sh
export HOME=$HOME_OLD
# Path to solvespace-2
#include <string>
#include <list>
-static const char* SKETCH_TAB_NAME = "Sketch";
+static const char SKETCH_TAB_NAME[] = "Sketch";
/*!
* \class Config_Prop
// Building and getting result.
aBuilder->Perform();
-#ifdef USE_OCCT_720
if (aBuilder->HasErrors())
return;
-#else
- if(aBuilder->ErrorStatus() != 0) {
- return;
- }
-#endif
TopoDS_Shape aResult = aBuilder->Shape();
if(aResult.ShapeType() == TopAbs_COMPOUND) {
aShape.Nullify();
}
}
- catch( Standard_Failure ) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- theError = aFail->GetMessageString();
+ catch( Standard_Failure const& anException) {
+ theError = anException.GetMessageString();
aShape.Nullify();
}
// parameters of the volume maker
aVolumeMaker->SetArguments(anArgs);
aVolumeMaker->SetIntersect(true); // split edges and faces
-#ifdef USE_OCCT_720
aVolumeMaker->SetAvoidInternalShapes(true);
-#endif
aVolumeMaker->SetGlue(BOPAlgo_GlueOff);
// building and getting result
aVolumeMaker->Perform();
-#ifdef USE_OCCT_720
if (aVolumeMaker->HasErrors())
return;
-#else
- if(aVolumeMaker->ErrorStatus() != 0) {
- return;
- }
-#endif
TopoDS_Shape aResult = aVolumeMaker->Shape();
if(aResult.ShapeType() == TopAbs_COMPOUND) {
// Building and getting result.
anOperation->Perform();
-#ifdef USE_OCCT_720
if (anOperation->HasErrors())
return;
-#else
- if(anOperation->ErrorStatus() != 0) {
- return;
- }
-#endif
TopoDS_Shape aResult = anOperation->Shape();
if(aResult.ShapeType() == TopAbs_COMPOUND) {
}
aPaveFiller->SetArguments(aListOfShape);
aPaveFiller->Perform();
-#ifdef USE_OCCT_720
if (aPaveFiller->HasErrors())
return;
-#else
- Standard_Integer iErr = aPaveFiller->ErrorStatus();
- if(iErr) {
- return;
- }
-#endif
BOPAlgo_Builder* aBuilder = new BOPAlgo_Builder();
this->setImpl(aBuilder);
this->setBuilderType(OCCT_BOPAlgo_Builder);
aBuilder->SetArguments(aListOfShape);
aBuilder->PerformWithFiller(*aPaveFiller);
-#ifdef USE_OCCT_720
if (aBuilder->HasErrors())
return;
-#else
- iErr = aBuilder->ErrorStatus();
- if(iErr) {
- return;
- }
-#endif
TopoDS_Shape aResult = aBuilder->Shape();
if(aResult.ShapeType() == TopAbs_COMPOUND) {
aResShape.Nullify();
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- theError = aFail->GetMessageString();
+ catch (Standard_Failure const& anException) {
+ theError = anException.GetMessageString();
aResShape.Nullify();
}
// Return previous locale
}
}
}
- } else if(aBaseShapeType == GeomAPI_Shape::FACE) {
- if(aShapeToAddType == GeomAPI_Shape::EDGE) {
+ } else if(aBaseShapeType == TopAbs_FACE) {
+ if(aShapeToAddType == TopAbs_EDGE) {
aShapeToAdd.Orientation(TopAbs_INTERNAL);
TopoDS_Wire aWire;
aBuilder.MakeWire(aWire);
}
aBOP.Perform();
-#ifdef USE_OCCT_720
if (aBOP.HasErrors())
return;
-#else
- if (aBOP.ErrorStatus())
- return;
-#endif
// Collect splits
const TopTools_ListOfShape& aSplits = aBOP.Modified(aBaseEdge);
}
aBOP.Perform();
-#ifdef USE_OCCT_720
if (aBOP.HasErrors())
return;
-#else
- if (aBOP.ErrorStatus())
- return;
-#endif
// Collect splits
const TopTools_ListOfShape& aSplits = aBOP.Modified(aBaseEdge);
aBB.AddArgument(anEdge);
}
aBB.Perform();
-#ifdef USE_OCCT_720
if (aBB.HasErrors())
return;
-#else
- if (aBB.ErrorStatus())
- return;
-#endif
// Collect faces
TopTools_ListOfShape anAreas = aBB.Modified(aPlnFace);
sortFaces(anAreas, theFeatures); // sort faces by the edges in them
const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
const ShapeUpgrade_UnifySameDomain& aUnifyAlgo = this->impl<ShapeUpgrade_UnifySameDomain>();
- TopoDS_Shape aModifiedShape = aUnifyAlgo.Generated(aShape);
+ const TopTools_ListOfShape& aMList = aUnifyAlgo.History()->Generated(aShape);
+ for(TopTools_ListIteratorOfListOfShape aModified(aMList); aModified.More(); aModified.Next()) {
- for(TopExp_Explorer anExp(aModifiedShape, aShape.ShapeType()); anExp.More(); anExp.Next()) {
- GeomShapePtr aGeomShape(new GeomAPI_Shape());
- aGeomShape->setImpl(new TopoDS_Shape(anExp.Current()));
- theHistory.push_back(aGeomShape);
+ for(TopExp_Explorer anExp(aModified.Value(), aShape.ShapeType()); anExp.More(); anExp.Next()) {
+ GeomShapePtr aGeomShape(new GeomAPI_Shape());
+ aGeomShape->setImpl(new TopoDS_Shape(anExp.Current()));
+ theHistory.push_back(aGeomShape);
+ }
}
}
//=======================================================================
void GEOMAlgo_Splitter::BuildResult(const TopAbs_ShapeEnum theType)
{
-#ifndef USE_OCCT_720
- myErrorStatus=0;
-#endif
- //
TopAbs_ShapeEnum aType;
BRep_Builder aBB;
BOPCol_MapOfShape aM;
Handle(TDocStd_Document) aLoaded;
try {
aStatus = anApp->Open(aPath, aLoaded);
- } catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ } catch (Standard_Failure const& anException) {
Events_InfoMessage("Model_Document",
- "Exception in opening of document: %1").arg(aFail->GetMessageString()).send();
+ "Exception in opening of document: %1").arg(anException.GetMessageString()).send();
return false;
}
bool isError = aStatus != PCDM_RS_OK;
PCDM_StoreStatus aStatus;
try {
aStatus = anApp->SaveAs(myDoc, aPath);
- } catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ } catch (Standard_Failure const& anException) {
Events_InfoMessage("Model_Document",
- "Exception in saving of document: %1").arg(aFail->GetMessageString()).send();
+ "Exception in saving of document: %1").arg(anException.GetMessageString()).send();
if (aWasCurrent.get()) { // return the current feature to the initial position
setCurrentFeature(aWasCurrent, false);
aSession->setCheckTransactions(true);
aSession->closeAll();
// execute the dumped
PyGILState_STATE gstate = PyGILState_Ensure(); /* acquire python thread */
- PyObject* PyFileObject = PyFile_FromString("./check_dump.py", "r");
- PyRun_SimpleFileEx(PyFile_AsFile(PyFileObject), "./check_dump.py", 1);
+ static char aDumpName[] = "./check_dump.py";
+ static char aReadMode[] = "r";
+ PyObject* PyFileObject = PyFile_FromString(aDumpName, aReadMode);
+ PyRun_SimpleFileEx(PyFile_AsFile(PyFileObject), aDumpName, 1);
PyGILState_Release(gstate); /* release python thread */
// compare with the stored data
/// \param theStyle a style of presentation
/// \param theMode a drawing mode
virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& aPM,
- const Handle(Graphic3d_HighlightStyle)& theStyle, const Standard_Integer theMode = 0)
+ const Handle(Prs3d_Drawer)& theStyle, const Standard_Integer theMode = 0)
{
Selectable()->HilightOwnerWithColor(aPM, theStyle, this);
}
//********************************************************************
void ModuleBase_ResultPrs::HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM,
- const Handle(Graphic3d_HighlightStyle)& theStyle,
+ const Handle(Prs3d_Drawer)& theStyle,
const Handle(SelectMgr_EntityOwner)& theOwner)
{
Handle(StdSelect_BRepOwner) aOwner = Handle(StdSelect_BRepOwner)::DownCast(theOwner);
//! this selectable object ( for fast presentation draw )
Standard_EXPORT virtual void HilightOwnerWithColor(
const Handle(PrsMgr_PresentationManager3d)& thePM,
- const Handle(Graphic3d_HighlightStyle)& theStyle,
+ const Handle(Prs3d_Drawer)& theStyle,
const Handle(SelectMgr_EntityOwner)& theOwner);
/// Returns result object
#ifdef USE_OCCT_720
// to do: implement ball highlighting, in 7.2.0 this drawer is NULL
#else
+/*
if(aDrawer->HasOwnPointAspect()) {
Handle(Prs3d_PointAspect) aPntAspect = aDrawer->PointAspect();
if(aPixMap->IsEmpty()) {
aDrawer->SetPointAspect(aPntAspect);
theAIS->SetHilightAttributes(aDrawer);
}
+ */
#endif
}
const Prs3d_DatumParts& aPart = aTrOwner->DatumPart();
if (aPart >= Prs3d_DP_XAxis && aPart <= Prs3d_DP_ZAxis)
{
-#ifdef USE_OCCT_720
gp_Ax2 anAxis = aTrihedron->Component()->Ax2();
gp_Dir aDir = anAxis.XDirection();
gp_Lin aLine(aTrihedron->Component()->Location(), aDir);
return aPlane.Contains(aLine, Precision::Confusion(), Precision::Angular());
-#else
- Handle(Prs3d_Drawer) aDrawer = aTrihedron->Attributes();
- Handle(Prs3d_DatumAspect) aDatumAspect = aDrawer->DatumAspect();
- Handle(Graphic3d_ArrayOfPrimitives) aPrimitives =
- aDatumAspect->ArrayOfPrimitives(aPart);
- Standard_Real aX1, anY1, aZ1, aX2, anY2, aZ2;
- aPrimitives->Vertice(1, aX1, anY1, aZ1);
- aPrimitives->Vertice(2, aX2, anY2, aZ2);
- gp_Pnt aPnt1(aX1, anY1, aZ1);
- gp_Pnt aPnt2(aX2, anY2, aZ2);
- gp_Lin aLine(aPnt1, gp_Dir(gp_Vec(aPnt1, aPnt2)));
- return aPlane.Contains(aLine, Precision::Confusion(), Precision::Angular());
-#endif
}
}
}
}
void PartSet_CenterPrs::HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM,
- const Handle(Graphic3d_HighlightStyle)& theStyle,
+ const Handle(Prs3d_Drawer)& theStyle,
const Handle(SelectMgr_EntityOwner)& theOwner)
{
Handle( Prs3d_Presentation ) aHilightPrs = GetHilightPresentation( thePM );
virtual void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& PM,
const SelectMgr_SequenceOfOwner& Seq);
virtual void HilightOwnerWithColor (const Handle(PrsMgr_PresentationManager3d)&,
- const Handle(Graphic3d_HighlightStyle)&,
+ const Handle(Prs3d_Drawer)&,
const Handle(SelectMgr_EntityOwner)&);
DEFINE_STANDARD_RTTIEXT(PartSet_CenterPrs, AIS_Point)
Handle(AIS_InteractiveContext) aContext =
XGUI_Tools::workshop(myWorkshop)->viewer()->AISContext();
Quantity_Color aColor;
- Handle(Graphic3d_HighlightStyle) aHStyle = aContext->HighlightStyle();
- Handle(Graphic3d_HighlightStyle) aSStyle = aContext->SelectionStyle();
+ Handle(Prs3d_Drawer) aHStyle = aContext->HighlightStyle();
+ Handle(Prs3d_Drawer) aSStyle = aContext->SelectionStyle();
if (toActivate) {
std::vector<int> aColors;
aColors = Config_PropManager::color("Visualization", "sketch_entity_color");
void SketcherPrs_Coincident::SetColor(const Quantity_Color &aCol)
{
hasOwnColor=Standard_True;
-#ifndef USE_OCCT_720
- myOwnColor=aCol;
-#endif
}
void SketcherPrs_Coincident::SetCustomColor(const std::vector<int>& theColor)
// Update selection position only if there is no selected object
// because it can corrupt selection of other objects
- if ((myContext->NbCurrents() == 0) && (myContext->NbSelected() == 0)) {
+ if (myContext->NbSelected() == 0) {
myContext->MainSelector()->RebuildSensitivesTree(myObj);
myContext->MainSelector()->RebuildObjectsTree (false);
}
//*********************************************************************************
void SketcherPrs_SymbolPrs::HilightOwnerWithColor(
const Handle(PrsMgr_PresentationManager3d)& thePM,
- const Handle(Graphic3d_HighlightStyle)& theStyle,
+ const Handle(Prs3d_Drawer)& theStyle,
const Handle(SelectMgr_EntityOwner)& theOwner)
{
thePM->Color(this, theStyle);
//! this selectable object ( for fast presentation draw )
Standard_EXPORT virtual void HilightOwnerWithColor(
const Handle(PrsMgr_PresentationManager3d)& thePM,
- const Handle(Graphic3d_HighlightStyle)& theStyle,
+ const Handle(Prs3d_Drawer)& theStyle,
const Handle(SelectMgr_EntityOwner)& theOwner);
/// Returns sketcher plane
int anAnswer = QMessageBox::question(
desktop(), tr("Show object"),
tr("'%1'\n are hidden by %2:\nRemove objects from the panel to be displayed?")
- .arg(aHiddenObjectNames.join(' ,')).arg(facesPanel()->windowTitle()),
+ .arg(aHiddenObjectNames.join(", ")).arg(facesPanel()->windowTitle()),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
bool aToBeDisplayed = anAnswer == QMessageBox::Yes;