#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
+#include <Precision.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
const TopTools_ListOfShape& listModified = theAlgo->History()->Modified(aShape);
if (listModified.Extent() > 0)
{
- aModifSh = listModified.First();
+ aModifSh = listModified.First();
// Edge has been modified
aShapesToAdd.Append( aModifSh );
aGroupDef.Shapes.Remove( i );
- --i;
+ --i;
}
else if ( theAlgo->History()->IsRemoved(aShape) )
- {
+ {
// Edge has been removed
aGroupDef.Shapes.Remove( i );
--i;
}
-
- }
+
+ }
}
HYDROData_ShapesTool::AddShapes( aGroupDef.Shapes, aShapesToAdd );
aShapesToAdd.Append( aGeneratedByAlgo );
aGroupDef.Shapes.Remove( i );
--i;
- }
+ }
}
HYDROData_ShapesTool::AddShapes( aGroupDef.Shapes, aShapesToAdd );
TDF_ChildIDIterator aChildIt( aLabel, TNaming_NamedShape::GetID() );
for ( ; aChildIt.More(); aChildIt.Next() )
{
- Handle(TNaming_NamedShape) aNamedShape =
+ Handle(TNaming_NamedShape) aNamedShape =
Handle(TNaming_NamedShape)::DownCast( aChildIt.Value() );
if ( aNamedShape.IsNull() )
continue;
}
//=======================================================================
//function : HYDROData_Transform
-//purpose :
+//purpose :
//=======================================================================
HYDROData_Transform::HYDROData_Transform()
:
}
//=======================================================================
//function : ~
-//purpose :
+//purpose :
//=======================================================================
HYDROData_Transform::~HYDROData_Transform()
{
}
//=======================================================================
//function : Clear
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::Clear()
{
myBuilder=NULL;
}
//
- BOPAlgo_BuilderShape::PrepareHistory();
+ //BOPAlgo_BuilderShape::PrepareHistory();
}
//=======================================================================
//function : SetArgument
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::SetArgument(const TopoDS_Shape& theShape)
{
}
//=======================================================================
//function : AddArgument
-//purpose :
+//purpose :
//=======================================================================
const TopoDS_Shape& HYDROData_Transform::Argument()const
{
}
//=======================================================================
//function : SetTreshold
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::SetTreshold(const Standard_Real theTreshold)
{
}
//=======================================================================
//function : Treshold
-//purpose :
+//purpose :
//=======================================================================
-Standard_Real HYDROData_Transform::Treshold()const
+Standard_Real HYDROData_Transform::Treshold()const
{
return myTreshold;
}
//=======================================================================
//function : SetToTransform
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::SetToTransform(const Standard_Boolean theFlag)
{
}
//=======================================================================
//function : ToTransform
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean HYDROData_Transform::ToTransform()const
{
}
//=======================================================================
//function : CheckData
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::CheckData()
{
}
//=======================================================================
//function : Prepare
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::Prepare()
{
}
//=======================================================================
//function : Perform
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::Perform()
{
}
//=======================================================================
//function : Detect
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::Detect()
{
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
Standard_Real aXc, aYc, aZc;
- Bnd_Box aBox;
+ Bnd_Box aBox;
gp_Vec aVec;
//
myErrorStatus=0;
//printf(" aVc : { %lf %lf %lf }\n", aXc, aYc, aZc);
//
myToTransform=Standard_False;
- if (fabs(aXc)>myTreshold ||
- fabs(aYc)>myTreshold ||
+ if (fabs(aXc)>myTreshold ||
+ fabs(aYc)>myTreshold ||
fabs(aZc)>myTreshold) {
myToTransform=!myToTransform;
- }
+ }
//
aVec.SetCoord(-aXc, -aYc, -aZc);
myTrsf1.SetTranslation(aVec);
}
//=======================================================================
//function : ComputeTrsf
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::ComputeTrsf()
{
}
//=======================================================================
//function : Transform1
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::Transform1()
-{
+{
myErrorStatus=0;
//
if (myToTransform) {//pkv ft
}
//=======================================================================
//function : BuildFuse
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::BuildFuse()
{
aPF.SetArguments(aLC);
//
aPF.Perform();
- if (aPF.HasErrors())
+ if (aPF.HasErrors())
{
myErrorStatus=20;
return;
}
//=======================================================================
//function : Transform2
-//purpose :
+//purpose :
//=======================================================================
void HYDROData_Transform::Transform2()
{
//
//=======================================================================
//function : Modified
-//purpose :
+//purpose :
//=======================================================================
const TopTools_ListOfShape& HYDROData_Transform::Modified
(const TopoDS_Shape& aS)
}
//=======================================================================
//function : Generated
-//purpose :
+//purpose :
//=======================================================================
const TopTools_ListOfShape& HYDROData_Transform::Generated
(const TopoDS_Shape& aS)
}
//=======================================================================
//function : IsDeleted
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean HYDROData_Transform::IsDeleted(const TopoDS_Shape& aS)
{
}
//=======================================================================
//function : HasDeleted
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean HYDROData_Transform::HasDeleted()
{
}
//=======================================================================
//function : HasGenerated
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean HYDROData_Transform::HasGenerated()
{
}
//=======================================================================
//function : HasModified
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean HYDROData_Transform::HasModified()
{
//
#include <HYDROGUI_AISShape.h>
+#include <PrsMgr_PresentationManager.hxx>
#include <AIS_DisplayMode.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_LineAspect.hxx>
}
void HYDROGUI_AISShape::Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
- const Handle(Prs3d_Presentation)& thePresentation,
+ const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode )
{
thePresentation->Clear();
if( isActive )
{
const int aSelectionMode = 1;
- ctx->OpenLocalContext( Standard_True );
+ //ctx->OpenLocalContext( Standard_True );
foreach( Handle(HYDROGUI_BathymetryPrs) bath, baths )
{
ctx->Activate( bath, aSelectionMode, Standard_True );
bath->GetShape()->TextLabels( false );
ctx->Deactivate( bath );
}
- ctx->CloseLocalContext( -1, Standard_True );
+ //ctx->CloseLocalContext( -1, Standard_True );
}
myIsActive = isActive;
myMeasDlg = new HYDROGUI_MeasurementToolDlg( module()->getApp()->desktop() );
myMeasDlg->setModal( false );
myMeasDlg->setWindowTitle(getName());
- myMeasDlg->show();
+ myMeasDlg->show();
//Tool: draw a distance line
LightApp_Application* anApp = module()->getApp();
OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer();
- disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
aViewer, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
- connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
//polyline names
Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
if ( aCtx.IsNull() )
- return;
+ return;
gp_Pnt aPnt = CurveCreator_Utils::ConvertClickToPoint( theEvent->x(), theEvent->y(), aView );
{
myLineMaker = new BRepLib_MakePolygon();
myLineMaker->Add(aPnt);
- aRes = myLineMaker->FirstVertex();
+ aRes = myLineMaker->FirstVertex();
}
else
- {
+ {
myLineMaker->Add(aPnt);
aRes = myLineMaker->Shape();
const TopoDS_Edge& aLE = myLineMaker->Edge();
if ( !myAISLineM.IsNull() )
{
- if ( aCtx->HasOpenedContext() )
- aCtx->CloseLocalContext();
+// if ( aCtx->HasOpenedContext() )
+// aCtx->CloseLocalContext();
aCtx->Erase( myAISLineM, Standard_False );
}
}
continue;
TopExp_Explorer expW(W, TopAbs_EDGE);
if (!expW.More())
- continue;
+ continue;
TopoDS_Edge E = TopoDS::Edge(expW.Current());
expW.Next();
if (expW.More())
params.push_back(aKnots(i));
}
}
- //in some cases, extrema gives inaccurate result ->
+ //in some cases, extrema gives inaccurate result ->
//split bspline by knot params and try to find minimum distance
//on each interval
std::sort(params.begin(), params.end());
double WinDiagDist = sqrt ((double)aWinSX*(double)aWinSX + (double)aWinSY*(double)aWinSY);
if (fdist <= prec || pd / WinDiagDist < 0.08)
{
- if (fdist < fdist_min)
+ if (fdist < fdist_min)
{
- fdist_min = fdist;
+ fdist_min = fdist;
minWire = W;
minU = aProj.LowerDistanceParameter();
minC.Initialize(E);
{
if (myFW.IsSame(minWire))
{
- //calc distance on current curve
- double LenAlongCurv = GCPnts_AbscissaPoint::Length(minC, myFu, minU);
+ //calc distance on current curve
+ double LenAlongCurv = GCPnts_AbscissaPoint::Length(minC, myFu, minU);
myFW = TopoDS_Wire();
if (!BRep_Tool::IsClosed(minWire))
{
//anAspect->SetTypeOfMarker(Aspect_TOM_RING1);
//anAspect->SetColor(Quantity_NOC_BLACK);
//mySplitPointPreview->Attributes()->SetPointAspect( anAspect );
-
+
aCtx->SetZLayer(myAISLineM, Graphic3d_ZLayerId_Topmost);
- if ( aCtx->HasOpenedContext() )
- aCtx->CloseLocalContext();
- aCtx->Display( myAISLineM, Standard_False );
+// if ( aCtx->HasOpenedContext() )
+// aCtx->CloseLocalContext();
+ aCtx->Display( myAISLineM, Standard_False );
aCtx->UpdateCurrentViewer();
}
Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
if ( !aCtx.IsNull() )
{
- if ( aCtx->HasOpenedContext() )
- aCtx->CloseLocalContext();
+// if ( aCtx->HasOpenedContext() )
+// aCtx->CloseLocalContext();
aCtx->Erase( myAISLineM, Standard_False );
}
myAISLineM.Nullify();
aCtx->UpdateCurrentViewer();
- }
+ }
}
}
}
if (aViewManager && aViewer)
{
- disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
- connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
aViewManager->getOCCViewer(), SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
}
return;
Handle(AIS_InteractiveContext) aContext = aViewer->getAISContext();
- bool isLocalContext = aContext->HasOpenedContext();
+ //bool isLocalContext = aContext->HasOpenedContext();
AIS_ListOfInteractive aSelList;
aViewer->getSelectedObjects( aSelList );
for ( AIS_ListIteratorOfListOfInteractive anIt( aSelList ); anIt.More(); anIt.Next() )
if ( !anIt.Value().IsNull() )
{
- if ( !isLocalContext ) {
+ //if ( !isLocalContext ) {
QString anEntry = entry( anIt.Value() );
if ( !anEntry.isEmpty() ) {
aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( entry( anIt.Value() ) ) ) );
} else {
aList.append( SUIT_DataOwnerPtr( new HYDROGUI_DataOwner( anIt.Value() ) ) );
}
- }
+ //}
}
// add externally selected objects
SUIT_DataOwnerPtrList::const_iterator anExtIter;
int aViewerId = (size_t)aViewer;
Handle(AIS_InteractiveContext) aContext = aViewer->getAISContext();
- if ( aContext.IsNull() || aContext->HasOpenedContext() ) {
+ if ( aContext.IsNull() ) {
return;
}
if ( !entryStr.isEmpty() )
aDisplayed.insert( entryStr, it.Value() );
}*/
-
+
mySelectedExternals.clear();
for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
mySelectedExternals.append(*itr);
}
}
-
+
aViewer->unHighlightAll( false );
aViewer->setObjectsSelected( aSelList );
}
if ( anAIS.IsNull() || !anAIS->HasOwner() )
return aRes;
- Handle(HYDROData_Entity) anObj =
+ Handle(HYDROData_Entity) anObj =
Handle(HYDROData_Entity)::DownCast( anAIS->GetOwner() );
if ( !anObj.IsNull() )
aRes = HYDROGUI_DataObject::dataObjectEntry( anObj );
HYDROGUI_Polyline::HYDROGUI_Polyline(const TopoDS_Shape& shape)
: AIS_Shape(shape)
-{
+{
}
HYDROGUI_Polyline::~HYDROGUI_Polyline()
void HYDROGUI_Polyline::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPrs,
const Standard_Integer aMode)
-{
+{
//AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
// return;
aPrs->Clear();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup( aPrs );
- Quantity_Color aColor;
- Aspect_TypeOfLine aType;
- Standard_Real anWidth;
- Attributes()->LineAspect()->Aspect()->Values( aColor, aType, anWidth );
+ Quantity_Color aColor = Attributes()->LineAspect()->Aspect()->Color();
+ Aspect_TypeOfLine aType = Attributes()->LineAspect()->Aspect()->Type();
+ Standard_Real anWidth = Attributes()->LineAspect()->Aspect()->Width();
anWidth =2;
Handle(Graphic3d_AspectLine3d) anAspect = new Graphic3d_AspectLine3d( aColor, aType, anWidth );
for ( ; Exp.More(); Exp.Next() )
{
TopoDS_Edge anEdge = TopoDS::Edge(Exp.Current());
- if ( !anEdge.IsNull() )
+ if ( !anEdge.IsNull() )
{
Handle(HYDROGUI_Arrow) arrow = new HYDROGUI_Arrow( anEdge, aMPoly );
if( theType>=0 )
aPrs->Clear();
if( myType==None )
return;
-
+
TopoDS_Edge anEdge = TopoDS::Edge( myshape );
if( anEdge.IsNull() )
return;
}
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup( aPrs );
- Quantity_Color aColor;
- Aspect_TypeOfLine aType;
- Standard_Real anWidth;
- Attributes()->LineAspect()->Aspect()->Values( aColor, aType, anWidth );
+ Quantity_Color aColor = Attributes()->LineAspect()->Aspect()->Color();
+ Aspect_TypeOfLine aType = Attributes()->LineAspect()->Aspect()->Type();
+ Standard_Real anWidth = Attributes()->LineAspect()->Aspect()->Width();
anWidth = 1;
const Handle(HYDROGUI_Polyline)& aParentPoly = getParentPolyline();
if ( !myObject.IsNull() )
{
Handle(HYDROData_Document) aDocument = HYDROData_Document::Document();
-
+
if ( myObject->IsKind( STANDARD_TYPE(HYDROData_ImmersibleZone) ) )
{
Handle(HYDROData_ImmersibleZone) aZoneObj =
if ( aPolylineShape.ShapeType() == TopAbs_WIRE )
{
TopoDS_Wire aPolylineWire = TopoDS::Wire( aPolylineShape );
- setWire( aPolylineWire, false, false );
+ setWire( aPolylineWire, false, false );
}
else
{
QColor aColor;
aPolyline->GetSectionColor(i, aColor);
aSectColors.push_back(aColor);
- }
+ }
//
//setBorderColor( aWireColor, false, false );
for (int i=0;i<nbSec;i++)
{
const TopoDS_Shape& CW = MW(i+1);
- Quantity_Color aFColor( getQuantityColorVal( aSectColors[i].red() ),
+ Quantity_Color aFColor( getQuantityColorVal( aSectColors[i].red() ),
getQuantityColorVal( aSectColors[i].green() ),
getQuantityColorVal( aSectColors[i].blue() ),
Quantity_TOC_RGB );
}
}
}
- }
+ }
- //if ( theToDisplay && isVisible() && !myContext.IsNull() )
+ //if ( theToDisplay && isVisible() && !myContext.IsNull() )
// displayShape( false );
}
else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Polyline3D) ) )
if ( !aPolylineShape.IsNull() ) {
if ( aPolylineShape.ShapeType() == TopAbs_WIRE ) {
TopoDS_Wire aPolylineWire = TopoDS::Wire( aPolylineShape );
- setWire( aPolylineWire, false, false );
+ setWire( aPolylineWire, false, false );
} else {
myTopoShape = aPolylineShape;
// Set shading mode to avoid that hilight presentation is equal to "normal" object presentation.
if ( aProfile->IsValid() ) {
TopoDS_Shape aProfileShape = aProfile->GetShape3D();
- if ( !aProfileShape.IsNull() &&
+ if ( !aProfileShape.IsNull() &&
aProfileShape.ShapeType() == TopAbs_WIRE ) {
aProfileWire = TopoDS::Wire( aProfileShape );
}
}
- setWire( aProfileWire, false, false );
+ setWire( aProfileWire, false, false );
QColor aWireColor = aProfile->GetBorderColor();
setBorderColor( aWireColor, false, false );
aCompoundBuilder.Add( aCompound, aShape );
}
- setShape( aCompound, false, false );
+ setShape( aCompound, false, false );
}
else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_BCPolygon) ) )
{
Handle(HYDROData_BCPolygon) aBCObj = Handle(HYDROData_BCPolygon)::DownCast( myObject );
TopoDS_Shape aBCShape = aBCObj->GetTopShape();
- if ( !aBCShape.IsNull() )
+ if ( !aBCShape.IsNull() )
{
- if ( aBCShape.ShapeType() == TopAbs_FACE )
+ if ( aBCShape.ShapeType() == TopAbs_FACE )
{
TopoDS_Face aBCFace = TopoDS::Face( aBCShape );
setFace( aBCFace, false, false, "" );
- }
- else
+ }
+ else
{
myTopoShape = aBCShape;
myDisplayMode = AIS_Shaded;
}
}
-
+
if ( myShapes.empty() || !isVisible() )
return;
void HYDROGUI_Shape::setBorderColor( const QColor& theColor,
const bool theToDisplay,
const bool theIsUpdateViewer )
-{
+{
myBorderColor = theColor;
updateShape( theToDisplay, theIsUpdateViewer );
}
anIsoAspect->SetNumber( 0 );
anAttributes->SetUIsoAspect( anIsoAspect );
}
-
+
anIsoAspect = anAttributes->VIsoAspect();
if ( !anIsoAspect.IsNull() )
{
{
if ( myDisplayMode == AIS_Shaded && myFillingColor.isValid() )
{
- Quantity_Color aFillingColor( getQuantityColorVal( myFillingColor.red() ),
+ Quantity_Color aFillingColor( getQuantityColorVal( myFillingColor.red() ),
getQuantityColorVal( myFillingColor.green() ),
getQuantityColorVal( myFillingColor.blue() ),
Quantity_TOC_RGB );
-
+
aShape->SetColor( aFillingColor );
aShape->SetTransparency( 1 - getQuantityColorVal( myFillingColor.alpha() ) );
}
else if ( myDisplayMode == AIS_WireFrame )
{
}
-
+
// Coloring borders
}
}
-
+
colorShapeBorder( myBorderColor );
if ( !theToDisplay || !isVisible() || myContext.IsNull() )
return;
-
+
displayShape( theIsUpdateViewer );
}
void HYDROGUI_Shape::displayShape( const bool theIsUpdateViewer )
{
- if ( myContext->HasOpenedContext() && mySelectionMode > 0 )
- myContext->CloseLocalContext();
+// if ( myContext->HasOpenedContext() && mySelectionMode > 0 )
+// myContext->CloseLocalContext();
foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
{
myContext->Display( aShape, myDisplayMode, mySelectionMode, Standard_False, Standard_False );
else
{
- if ( !myContext->HasOpenedContext() )
- // Ordinary display of object published in the Object Browser
- myContext->Display( aShape, Standard_False );
- else
+// if ( !myContext->HasOpenedContext() )
+// Ordinary display of object published in the Object Browser
+// myContext->Display( aShape, Standard_False );
+// else
// Display object in local context without selection
myContext->Display( aShape, myDisplayMode, -1, Standard_False, Standard_False );
}
}
-
+
if ( mySelectionMode > 0 )
{
- myContext->OpenLocalContext();
+ //myContext->OpenLocalContext();
foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
myContext->Activate( aShape, mySelectionMode, Standard_True );
}
void HYDROGUI_Shape::eraseShape( const bool theIsUpdateViewer )
{
- if ( myContext->HasOpenedContext() && mySelectionMode > 0 )
- myContext->CloseLocalContext();
+// if ( myContext->HasOpenedContext() && mySelectionMode > 0 )
+// myContext->CloseLocalContext();
foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
myContext->Erase( aShape, Standard_False );
if ( anAttributes.IsNull() )
continue;
- Quantity_Color aBorderColor( getQuantityColorVal( theColor.red() ),
+ Quantity_Color aBorderColor( getQuantityColorVal( theColor.red() ),
getQuantityColorVal( theColor.green() ),
getQuantityColorVal( theColor.blue() ),
Quantity_TOC_RGB );
-
+
if( !myTopoShape.IsNull() )
{
if ( myTopoShape.ShapeType() == TopAbs_WIRE ) // Note that we display polylines in shaded mode
{
if( !myRangeInitialized )
{
- HYDROGUI_ShapeBathymetry* that =
+ HYDROGUI_ShapeBathymetry* that =
const_cast<HYDROGUI_ShapeBathymetry*>( this );
that->RescaleDefault();
that->myRangeInitialized = true;
Handle(AIS_InteractiveContext) c = getContext();
if( !c.IsNull() )
{
- Handle(AIS_LocalContext) lc = c->LocalContext();
- if( !lc.IsNull() )
- {
- for( lc->InitSelected(); lc->MoreSelected(); lc->NextSelected() )
+ for( c->InitSelected(); c->MoreSelected(); c->NextSelected() )
{
- Handle(HYDROGUI_BathymetryPointOwner) anOwner =
- Handle(HYDROGUI_BathymetryPointOwner)::DownCast( lc->SelectedOwner() );
+ Handle(HYDROGUI_BathymetryPointOwner) anOwner =
+ Handle(HYDROGUI_BathymetryPointOwner)::DownCast( c->SelectedOwner() );
if( !anOwner.IsNull() && anOwner->Selectable()==obj )
selected.append( anOwner->GetIndex() );
}
- }
}
return selected;
}
{
HYDROGUI_Operation::startOperation();
- HYDROGUI_SplitPolylinesDlg* aPanel =
+ HYDROGUI_SplitPolylinesDlg* aPanel =
::qobject_cast<HYDROGUI_SplitPolylinesDlg*>( inputPanel() );
if ( !aPanel )
return;
anOp.Split( doc(), aPolylinesList, aTolerance );
break;
}
-
+
theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
return true;
}
myPreviewPrs = 0;
}
- HYDROGUI_SplitPolylinesDlg* aPanel =
+ HYDROGUI_SplitPolylinesDlg* aPanel =
::qobject_cast<HYDROGUI_SplitPolylinesDlg*>( inputPanel() );
if ( !aPanel )
return;
Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
if ( !aCtx.IsNull() )
{
- if ( aCtx->HasOpenedContext() )
- aCtx->CloseLocalContext();
+// if ( aCtx->HasOpenedContext() )
+// aCtx->CloseLocalContext();
aCtx->Erase( mySplitPointPreview, Standard_False );
}
mySplitPointPreview = 0;
}
-
+
if ( aPanel->GetMode() == HYDROGUI_SplitPolylinesDlg::ByPoint )
{
- disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
- connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
aViewer, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
}
}
if ( mySplitPointPreview )
{
- if ( aCtx->HasOpenedContext() )
- aCtx->CloseLocalContext();
+// if ( aCtx->HasOpenedContext() )
+// aCtx->CloseLocalContext();
if ( aPanel->GetMode() == HYDROGUI_SplitPolylinesDlg::ByPoint )
{
if ( !aCtx->IsDisplayed( mySplitPointPreview ) )
aCtx->Display( mySplitPointPreview, Standard_False );
}
else
- aCtx->Erase( mySplitPointPreview, Standard_False );
+ aCtx->Erase( mySplitPointPreview, Standard_False );
}
aCtx->ClearSelected(true);
if ( aPanel->GetMode() == HYDROGUI_SplitPolylinesDlg::ByPoint )
{
- disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
aViewer, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
- connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
}
else
{
- disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
- connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
aViewer, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
}
}
TopoDS_Compound aShape;
aBuilder.MakeCompound(aShape);
aBuilder.Add(aShape, BRepBuilderAPI_MakeVertex( aPnt ) );
-
+
if ( mySplitPointPreview )
{
- if ( aCtx->HasOpenedContext() )
- aCtx->CloseLocalContext();
+// if ( aCtx->HasOpenedContext() )
+// aCtx->CloseLocalContext();
aCtx->Erase( mySplitPointPreview, Standard_False );
}
mySplitPointPreview = new AIS_Shape( aShape );
- if ( aCtx->HasOpenedContext() )
- aCtx->CloseLocalContext();
+// if ( aCtx->HasOpenedContext() )
+// aCtx->CloseLocalContext();
aCtx->Display( mySplitPointPreview, Standard_False );
-
+
aCtx->UpdateCurrentViewer();
}
#include <HYDROGUI_ZLayers.h>
#include <PrsMgr_PresentableObject.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
+#include <PrsMgr_Presentations.hxx>
#include <TColStd_SequenceOfInteger.hxx>
void SetZLayerForPrs( const Handle(PrsMgr_Presentation)& thePrs, int theLayerId );
PrsMgr_Presentations& aPresentations = thePresentableObject->Presentations();
for (Standard_Integer aIdx = 1; aIdx <= aPresentations.Length (); aIdx++)
{
- Handle(PrsMgr_Presentation) aPrs = aPresentations (aIdx).Presentation ();
- if ( aPresentations (aIdx).Mode() == theMode )
+ Handle(PrsMgr_Presentation) aPrs = aPresentations (aIdx);
+ if ( aPrs->Mode() == theMode )
{
SetZLayerForPrs( aPrs, theLayerId );
}
{
TColStd_SequenceOfInteger anExistingZLayers;
theViewer->GetAllZLayers( anExistingZLayers );
-
+
int n = anExistingZLayers.Length();
for( int i=1; i<=n; i++ ) {
int aLayerId = anExistingZLayers( i );
{
myIndex++;
- if( myIndex >= (int)myZLayers.size() &&
+ if( myIndex >= (int)myZLayers.size() &&
!myViewer.IsNull() ) {
myNewZLayer = CreateTopZLayer( myViewer );
}
static QVector<QColor> aCV;
if( aCV.isEmpty() )
{
- aCV << QColor(0,0,255)
+ aCV << QColor(0,0,255)
<< QColor(0,255,0)
<< QColor(255,0,0)
- << QColor(255,255,20)
- << QColor(20,255,255)
- << QColor(100,100,20)
+ << QColor(255,255,20)
+ << QColor(20,255,255)
+ << QColor(100,100,20)
<< QColor(10,100,150);
}
if (i < aCV.size())
else
{
QColor TestColor = aCV[i % aCV.size()];
- QColor NewColor((TestColor.red() + i * 41) % 256,
- (TestColor.green() + i * 13) % 256,
+ QColor NewColor((TestColor.red() + i * 41) % 256,
+ (TestColor.green() + i * 13) % 256,
(TestColor.blue() + i * 23) % 256);
return NewColor;
}
void TestViewer::eraseAll( bool isUpdate, bool eraseStructures )
{
- context()->CloseLocalContext( -1, Standard_False );
+ //context()->CloseLocalContext( -1, Standard_False );
context()->EraseAll( isUpdate );
if( eraseStructures )
- {
+ {
Graphic3d_MapOfStructure GmapS;
viewer()->getViewer3d()->StructureManager()->DisplayedStructures(GmapS);
for (Graphic3d_MapOfStructure::Iterator it(GmapS); it.More(); it.Next())
myKey = aNewKey;
eraseAll( false, true );
}
-
+
if( theSelectionMode > 0 )
{
- context()->OpenLocalContext();
+ //context()->OpenLocalContext();
context()->Display( theObject, theMode, theSelectionMode, true );
context()->Activate( theObject, theSelectionMode, Standard_True );
}
int theUIANb, int theVIANb)
{
Handle(AIS_Shape) aShape = new AIS_Shape( theShape );
- cout <<theShape;
+ std::cout <<theShape;
if( theShape.ShapeType()==TopAbs_VERTEX )
aShape->Attributes()->PointAspect()->SetTypeOfMarker( Aspect_TOM_X );
if (theShape.ShapeType()==TopAbs_FACE)
QString anExpectedRefFilePath = REF_DATA_PATH;
anExpectedRefFilePath += "/" + myKey + ".png";
- QImage anExpectedRefImage;
+ QImage anExpectedRefImage;
anExpectedRefImage.load( anExpectedRefFilePath );
//std::cout << "Expected image loading: " << anExpectedRefFilePath.toStdString() << std::endl;
QString aPath = TMP_DIR + "/" + myKey + ".png";
anActualImage.save( aPath );
//std::cout << "Actual image: " << aPath.toStdString() << std::endl;
-
+
//std::cout << anActualImage.width() << "x" << anActualImage.height() << std::endl;
theMessage = "The viewer contents does not correspond to the reference image: " + myKey;
-
+
QImage aDiff = diff( anExpectedRefImage, anActualImage );
QString aDiffFilePath = TMP_DIR + "/" + myKey + "_diff.png";
{
QString anExpectedRefFilePath = REF_DATA_PATH;
anExpectedRefFilePath += "/" + theBaseName;
-
+
QString anActualFilePath = TMP_DIR + "/" + theBaseName;
QFile anExpected( anExpectedRefFilePath );
theMsg = QString( "line %1\nActual: %2\nExpected: %3" ).arg( i ).arg( anActualLine ).arg( anExpectedLine );
i++;
}
-
+
while( !anActual.atEnd() && isEqual )
{
QString anActualLine = GetLine( anActual, isActualUtf8 );