#include <TopoDS_Wire.hxx>
#include <TopoDS_Vertex.hxx>
+#include <Quantity_Parameter.hxx>
+
#define DEB_CHANNEL 1
#ifdef DEB_CHANNEL
#include <BRepTools.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <assert.h>
+#include <float.h>
IMPLEMENT_STANDARD_RTTIEXT( HYDROData_DTM, HYDROData_Bathymetry )
{
std::cout << "Warning: different number of points in curves: " << n << ", " << n1 << std::endl;
}
- int q = std::min(n, n1);
+ int q = min(n, n1);
res.reserve( q );
for( int i=0; i<q; i++ )
{
HYDROData_Profile::ProfilePoints points = theProfile->GetProfilePoints();
int lo = points.Lower();
int up = points.Upper();
- theZMin = std::numeric_limits<double>::max();
+ theZMin = DBL_MAX;
theZMax = -theZMin;
for( int i=lo; i<=up; i++ )
{
bool CalcMidWidth( const std::set<double>& intersections, double& theMid, double& theWid )
{
- double umin = std::numeric_limits<double>::max(),
+ double umin = DBL_MAX,
umax = -umin;
size_t n = intersections.size();
int& intersection_nb,
double theTolerance)
{
- double aDblMax = std::numeric_limits<double>::max(),
+ double aDblMax = DBL_MAX,
aUMin = aDblMax,
aUMax = -aUMin,
aVMax = 1000000;
thePoints.push_back( it->second );
}
-inline double max( double a, double b )
-{
- if( a>b )
- return a;
- else
- return b;
-}
-
-inline double min( double a, double b )
-{
- if( a<b )
- return a;
- else
- return b;
-}
+//inline double max( double a, double b )
+//{
+// if( a>b )
+// return a;
+// else
+// return b;
+//}
+//
+//inline double min( double a, double b )
+//{
+// if( a<b )
+// return a;
+// else
+// return b;
+//}
#include <BRepLib_MakeWire.hxx>
#include <HYDROData_Entity.h>
#include <TDocStd_Document.hxx>
+#include <MMgt_TShared.hxx>
class HYDROData_InterpolatorsFactory;
class HYDROData_IProfilesInterpolator;
{
TCollection_AsciiString aName = theName.toStdString().c_str();
theDefaultName = TDataStd_AsciiString::Set(myLab.FindChild( DataTag_DefaultName), aName );
+ theDefaultName->SetID( TDataStd_AsciiString::GetID() );
}
}
}
return;
aGeomChangeFlag = ( aGeomChangeFlag | aBitsToChange );
- TDataStd_Integer::Set( aGeomChangeLab, aGeomChangeFlag );
+ Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( aGeomChangeLab, aGeomChangeFlag );
+ anAttr->SetID( TDataStd_Integer::GetID() );
HYDROData_Iterator anIter( aDocument );
for ( ; anIter.More(); anIter.Next() )
Handle(TDataStd_ByteArray) aData;
if (!aLab.FindAttribute(TDataStd_ByteArray::GetID(), aData)) {
aData = TDataStd_ByteArray::Set(aLab, 1, theLen);
+ aData->SetID( TDataStd_ByteArray::GetID() );
}
Standard_Byte* Byte0 = &(aData->InternalArray()->ChangeArray1().ChangeFirst());
memcpy(Byte0, theData, theLen * sizeof (char));
Handle(TDataStd_ReferenceList) aRefs;
if ( !aLabel.FindAttribute( TDataStd_ReferenceList::GetID(), aRefs ) && theIsCreate )
+ {
aRefs = TDataStd_ReferenceList::Set( aLabel );
+ aRefs->SetID(TDataStd_ReferenceList::GetID());
+ }
return aRefs;
}
Handle(TDataStd_Real) anAttr;
TDF_Label aLabel = myLab.FindChild( theTag );
if( !aLabel.FindAttribute( TDataStd_Real::GetID(), anAttr ) )
- aLabel.AddAttribute( anAttr = new TDataStd_Real() );
+ {
+ anAttr = new TDataStd_Real();
+ anAttr->SetID(TDataStd_Real::GetID());
+ aLabel.AddAttribute( anAttr );
+ }
anAttr->Set( theValue );
}
Handle(TDataStd_Integer) anAttr;
TDF_Label aLabel = myLab.FindChild( theTag );
if( !aLabel.FindAttribute( TDataStd_Integer::GetID(), anAttr ) )
- aLabel.AddAttribute( anAttr = new TDataStd_Integer() );
+ {
+ anAttr = new TDataStd_Integer();
+ anAttr->SetID(TDataStd_Integer::GetID());
+ aLabel.AddAttribute(anAttr);
+ }
anAttr->Set( theValue );
}
#include <QMap>
#include <QString>
#include <Standard_Type.hxx>
-
+#include <MMgt_TShared.hxx>
#ifdef NONLS
#undef NONLS
aPF.SetFuzzyValue( theTolerance );
aPF.Perform();
- anError = aPF.ErrorStatus();
- if( anError )
+ if( aPF.HasErrors())
return TopoDS_Shape();
BOPAlgo_Builder anAlgo;
anAlgo.AddArgument( anIt.Value() );
anAlgo.PerformWithFiller( aPF );
- anError = anAlgo.ErrorStatus();
- if( anError )
+ if( anAlgo.HasErrors())
return TopoDS_Shape();
const TopoDS_Shape& aMergedShape = anAlgo.Shape();
// prepare pave filler
aPaveFiller.SetArguments( aShapesList );
aPaveFiller.Perform();
- Standard_Integer anError = aPaveFiller.ErrorStatus();
- if( anError )
+ if( aPaveFiller.HasErrors())
return false;
// add faces to builder
// perform the partition with the pave filler
aBuilder.PerformWithFiller( aPaveFiller );
- anError = aBuilder.ErrorStatus();
- if( anError )
+ if( aBuilder.HasErrors())
return false;
//std::cout << "History:" << std::endl;
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepOffsetAPI_NormalProjection.hxx>
#include <BRepAdaptor_Curve.hxx>
+#include <Quantity_Parameter.hxx>
#ifndef LIGHT_MODE
#include <GEOMBase.h>
if (!IE.IsEmpty())
{
//remove dummy face from shell; shell becomes valid
- const TopoDS_Shape& NDF = unif.Generated(DF);
+ const TopoDS_Shape& NDF = unif.History()->Modified(DF).First();
BRepTools_ReShape ReShaper;
ReShaper.Remove(NDF);
anUnitedShape = ReShaper.Apply(out);
{
TopoDS_Shape aShape = aGroupDef.Shapes.Value( i );
- TopoDS_Shape aGeneratedByAlgo = theAlgo->Generated( aShape );
+ TopoDS_Shape aGeneratedByAlgo = theAlgo->History()->Modified(aShape).First(); //??TODO check
if ( aGeneratedByAlgo.IsNull() )
{
// Edge has been removed
#endif
}
//======================================================================================
-Standard_Integer HYDROData_SplitToZonesTool::SplitFaces(const TopoDS_Compound& theComp,
+bool HYDROData_SplitToZonesTool::SplitFaces(const TopoDS_Compound& theComp,
HYDROData_Transform& theTool)
{
theTool.Clear();
const Standard_Boolean bToTransform = theTool.ToTransform();
theTool.SetToTransform(bToTransform);
theTool.Perform();
- Standard_Integer anErr = theTool.ErrorStatus();
- return anErr;
+ return theTool.HasErrors();
}
//======================================================================================
HYDROData_DataMapOfShapeListOfShape aDM1;
if(anInputSplitDataList.size() > 1) {
HYDROData_Transform splitTool;
- const Standard_Integer anErr = SplitFaces(aCmp, splitTool);
+ bool anErr = SplitFaces(aCmp, splitTool);
if(anErr)
return anOutputSplitDataList;
aResult = splitTool.Shape();
anAlgo.AddArgument( anIt.Value() );
anAlgo.Perform();
- anError = anAlgo.ErrorStatus();
- if (anError)
- return anError;
+ if (anAlgo.HasErrors())
+ return -1;
outShs = anAlgo.Modified( InSh );
if (outShs.IsEmpty())
/**
* Split input faces.
*/
- static Standard_Integer SplitFaces(const TopoDS_Compound& theComp, HYDROData_Transform& theTool);
+ static bool SplitFaces(const TopoDS_Compound& theComp, HYDROData_Transform& theTool);
};
#ifdef WIN32
myTransform1=NULL;
myTransform2=NULL;
myBuilder=NULL;
+ myErrorStatus=0;
+ myWarningStatus=0;
}
//=======================================================================
//function : ~
aPF.SetArguments(aLC);
//
aPF.Perform();
- iErr=aPF.ErrorStatus();
- if (iErr) {
+ if (aPF.HasErrors())
+ {
myErrorStatus=20;
return;
}
}
//
myBuilder->PerformWithFiller(aPF);
- iErr=myBuilder->ErrorStatus();
- if (iErr) {
+ if (myBuilder->HasErrors())
+ {
myErrorStatus=21;
return;
}
BRepBuilderAPI_Transform* myTransform1;
BRepBuilderAPI_Transform* myTransform2;
BOPAlgo_Builder* myBuilder;
+ //
+ int myErrorStatus; //no longer used since occt 7.2.1 (added for backcompatibility)
+ int myWarningStatus; //no longer used since occt 7.2.1
};
#endif
#include <Prs3d_Drawer.hxx>
#include <DsgPrs_XYZAxisPresentation.hxx>
#include <gp_Ax2.hxx>
+#include <Quantity_Length.hxx>
HYDROGUI_AISTrihedron::HYDROGUI_AISTrihedron( const Handle(Geom_Axis2Placement)& thePlacement )
: AIS_Trihedron(thePlacement)
if( myIsActive==isActive )
return;
- getContext( module() )->ClearSelected();
+ getContext( module() )->ClearSelected(true);
Handle(AIS_InteractiveContext) ctx = getContext( module() );
QList<Handle(HYDROGUI_BathymetryPrs)> baths = getShownBathymetries( module() );
if ( !aCtx.IsNull() )
{
myPolylineFacePreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
- aCtx->ClearSelected();
+ aCtx->ClearSelected(true);
myPolylineFacePreviewPrs->setBorderColor( Qt::white, false, false );
myPolylineFacePreviewPrs->setShape( aTopoDSShape, true, true, !aPolyline.IsNull() ? AIS_WireFrame : AIS_Shaded );
if ( !aViewer->isPreselectionEnabled() ) {
Handle(V3d_View) aView3d = aView->getViewPort()->getView();
if ( !aView3d.IsNull() ) {
- aCtx->MoveTo(myEndPnt.x(), myEndPnt.y(), aView3d);
+ aCtx->MoveTo(myEndPnt.x(), myEndPnt.y(), aView3d, true);
}
}
void HYDROGUI_LandCoverMapPrs::SetHilightAttributes( const Quantity_Color& theEdgesColor )
{
+ if (HilightAttributes().IsNull())
+ AIS_ColoredShape::SetHilightAttributes(new Prs3d_Drawer());
HilightAttributes()->UIsoAspect()->SetNumber( HILIGHT_ISO_NB );
HilightAttributes()->UIsoAspect()->SetColor( theEdgesColor );
HilightAttributes()->VIsoAspect()->SetNumber( HILIGHT_ISO_NB );
}
}
else if ( !aCtx.IsNull() ) { // TODO: determine if this code is necessary (added as a fix for issue# 359)
- aCtx->UpdateSelected();
+ aCtx->UpdateSelected(true);
}
UpdateColorScale( aViewer );
aCtx->Display( aColorScale, Standard_False );
}
- aCtx->Update( aColorScale );
+ aCtx->Update( aColorScale, true );
}
}
}
else
{
if ( !aCtx.IsNull() && aCtx->IsDisplayed( aColorScale ) ) {
- aCtx->Erase( aColorScale );
+ aCtx->Erase( aColorScale, true );
}
}
void HYDROGUI_ShapeBathymetry::Rescale( double theMin, double theMax )
{
- getContext()->ClearSelected();
+ getContext()->ClearSelected(true);
myMin = qMin( theMin, theMax );
myMax = qMax( theMin, theMax );
setToUpdateColorScale( true );
if( isOn )
selection = selected();
- getContext()->ClearSelected();
+ getContext()->ClearSelected(true);
prs->SetTextLabels( selection );
prs->Redisplay();
getContext()->UpdateCurrentViewer();
aCtx->Erase( mySplitPointPreview, Standard_False );
}
- aCtx->ClearSelected();
+ aCtx->ClearSelected(true);
}
if ( aPanel->GetMode() == HYDROGUI_SplitPolylinesDlg::ByPoint )
if ( !anAISContext.IsNull() && !aTrihedron.IsNull() )
{
viewer()->setTrihedronShown( false );
- anAISContext->Display( aTrihedron );
+ anAISContext->Display( aTrihedron, true );
anAISContext->Deactivate( aTrihedron );
}
}
#if OCC_VERSION_LARGE < 0x07010000
Quantity_NameOfColor aStyle = Quantity_NOC_YELLOW;
#else
- Handle(Graphic3d_HighlightStyle) aStyle = new Graphic3d_HighlightStyle( Aspect_TOHM_COLOR, Quantity_NOC_YELLOW );
+ Handle(Graphic3d_HighlightStyle) aStyle = new Graphic3d_HighlightStyle( /*Aspect_TOHM_COLOR, Quantity_NOC_YELLOW*/ );
+ aStyle->SetMethod(Aspect_TOHM_COLOR);
+ aStyle->SetColor(Quantity_NOC_YELLOW);
#endif
theContext->MainPrsMgr()->Color( aPrsObj, aStyle, aMode );
SetPrsZLayer( aPrsObj, aMode, theLayer );
SET( ECW_INCLUDES $ENV{ECWLIB_ROOT_DIR}/include )
IF( ${WIN32} )
- link_directories( $ENV{CASROOT}/win64/vc10/lib $ENV{GL2PS_DIR}/lib )
+ link_directories( $ENV{CASROOT}/win64/lib/vc10 $ENV{GL2PS_DIR}/lib )
ELSE()
link_directories( $ENV{CASROOT}/lib $ENV{TBB_ROOT_DIR}/lib/intel64/gcc4.4 )
ENDIF()
myViewManager = new OCCViewer_ViewManager( 0, 0 );
OCCViewer_Viewer* aViewer = new OCCViewer_Viewer( true );
- aViewer->setTrihedronSize( 100, true );
+ aViewer->setTrihedronSize( 0, true );
aViewer->setInteractionStyle( 0 );
aViewer->setZoomingStyle( 1 );
myViewManager->setViewModel( aViewer );
myViewWindow = dynamic_cast<OCCViewer_ViewFrame*>( myViewManager->createViewWindow() );
-
+ aViewer->setTrihedronShown( false );
return myViewManager;
}
if( theSelectionMode > 0 )
{
context()->OpenLocalContext();
- context()->Display( theObject, theMode, theSelectionMode );
+ context()->Display( theObject, theMode, theSelectionMode, true );
context()->Activate( theObject, theSelectionMode, Standard_True );
}
else
- context()->Display( theObject, theMode, theSelectionMode );
+ context()->Display( theObject, theMode, theSelectionMode, true );
if( isFitAll )
fitAll();
if( isShow )
{
if( !context()->IsDisplayed( aColorScale ) )
- context()->Display( aColorScale );
+ context()->Display( aColorScale, true );
}
else
{
if( context()->IsDisplayed( aColorScale ) )
- context()->Erase( aColorScale );
+ context()->Erase( aColorScale, true );
}
}
void TestViewer::select( int theViewX, int theViewY )
{
Handle(V3d_View) aView = myViewWindow->getViewPort()->getView();
- context()->MoveTo( theViewX, theViewY, aView );
- context()->Select();
+ context()->MoveTo( theViewX, theViewY, aView, true);
+ context()->Select(true);
// context()->CloseAllContexts();
}
#pragma once
#include <AIS_InteractiveContext.hxx>
+#include <Standard_Version.hxx>
class OCCViewer_ViewManager;
class OCCViewer_Viewer;
class AIS_InteractiveObject;
class AIS_ColorScale;
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)
+#if OCC_VERSION_LARGE >= 0x07020000
+const bool SWAP_RGB = false;
+#else
+const bool SWAP_RGB = true;
+#endif
+
class TestViewer
{
public:
int theUIANb = 10, int theVIANb = 10);
static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey,
int theUIANb = 10, int theVIANb = 10);
- static bool AssertImages( QString& theMessage, const QImage* = 0, const char* theCase = 0, bool swapRGB = true );
+ static bool AssertImages( QString& theMessage, const QImage* = 0, const char* theCase = 0, bool swapRGB = SWAP_RGB );
static QColor GetColor(int i);
static Handle(AIS_ColorScale) colorScale();
aProfile2->SetLeftPoint( gp_XY( 10, 10 ) );
aProfile2->SetRightPoint( gp_XY( 20, 20 ) );
- double aUMin1 = std::numeric_limits<double>::max(),
+ double aUMin1 = DBL_MAX,
aUMax1 = -aUMin1,
aUMin2 = aUMin1,
aUMax2 = aUMax1;
TestViewer::show( aPointsPrs, AIS_PointCloud::DM_Points, 0, true, "Polyline_Presentation_triangle" );
TestViewer::show( aPolyline2d->GetShape(), 0, true, Qt::red );
//TestViewer::show( aNewPolylinePrs, AIS_PointCloud::DM_Points, 0, true, "" );
- TestViewer::context()->RecomputePrsOnly( arr );
+ TestViewer::context()->RecomputePrsOnly( arr, true );
aNewPolylinePrs->display();
TestViewer::fitAll();
CPPUNIT_ASSERT_IMAGES