#include "HYDROGUI_PolylineOp.h"
#include <HYDROData_Image.h>
+#include <HYDROData_Profile.h>
#include <HYDROData_Lambert93.h>
#include <HYDROData_Tool.h>
bool anIsMustBeUpdatedImage = false;
bool anIsPolyline = false;
bool anIsProfile = false;
+ bool anIsValidProfile = false;
bool anAllAreProfiles = false;
bool anIsBathymetry = false;
bool anIsCalculation = false;
else if( anObject->GetKind() == KIND_PROFILE ) {
anIsProfile = true;
aNbOfSelectedProfiles++;
+
+ Handle(HYDROData_Profile) aProfile =
+ Handle(HYDROData_Profile)::DownCast( anObject );
+ if( !aProfile.IsNull() && aProfile->IsValid() ) {
+ anIsValidProfile = true;
+ }
}
else if( anObject->GetKind() == KIND_CALCULATION )
anIsCalculation = true;
theMenu->addAction( action( SetColorId ) );
theMenu->addSeparator();
}
- }
-
- if ( anAllAreProfiles ) {
+ } else if ( anAllAreProfiles ) {
theMenu->addAction( action( SelectedGeoreferencementId ) );
theMenu->addSeparator();
}
theMenu->addAction( action( DeleteId ) );
theMenu->addSeparator();
- if( anIsImage || anIsPolyline || anIsImmersibleZone || anIsZone || anIsRegion || anIsBathymetry || anIsObstacle )
+ if( anIsImage || anIsPolyline || anIsImmersibleZone || anIsZone ||
+ anIsRegion || anIsBathymetry || anIsObstacle || anIsValidProfile )
{
if( anIsHiddenInSelection )
theMenu->addAction( action( ShowId ) );
anObjectKind != KIND_IMMERSIBLE_ZONE &&
anObjectKind != KIND_REGION &&
anObjectKind != KIND_ZONE &&
- anObjectKind != KIND_OBSTACLE )
+ anObjectKind != KIND_OBSTACLE &&
+ anObjectKind != KIND_PROFILE )
return aResShape;
aResShape = new HYDROGUI_Shape( theContext, theObject );
#include <HYDROData_Region.h>
#include <HYDROData_Zone.h>
#include <HYDROData_Obstacle.h>
+#include <HYDROData_Profile.h>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
updateShape( false, false );
//TODO END of the block of code to be reimplemented
}
+ else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Profile) ) )
+ {
+ Handle(HYDROData_Profile) aProfile =
+ Handle(HYDROData_Profile)::DownCast( myObject );
+
+ if ( aProfile->IsValid() ) {
+ TopoDS_Shape aProfileShape = aProfile->GetShape3D();
+
+ if ( !aProfileShape.IsNull() ) {
+ if ( aProfileShape.ShapeType() == TopAbs_WIRE ) {
+ TopoDS_Wire aProfileWire = TopoDS::Wire( aProfileShape );
+ setWire( aProfileWire, false, false );
+ } else {
+ myTopoShape = aProfileShape;
+ myDisplayMode = AIS_WireFrame;
+
+ buildShape();
+ updateShape( false, false );
+ }
+ }
+ }
+ }
}
if ( myShape.IsNull() || !isVisible() )
( anObject->GetKind() == KIND_REGION ) ||
( anObject->GetKind() == KIND_BATHYMETRY ) ||
( anObject->GetKind() == KIND_ZONE ) ||
- ( anObject->GetKind() == KIND_OBSTACLE ) ) )
+ ( anObject->GetKind() == KIND_OBSTACLE ) ||
+ ( anObject->GetKind() == KIND_PROFILE ) ) )
{
theSeq.Append( anObject );
}