#include <HYDROData_Document.h>
#include <HYDROData_Image.h>
#include <HYDROData_ImmersibleZone.h>
+#include <HYDROData_Obstacle.h>
#include <HYDROData_PolylineXY.h>
+#include <HYDROData_Profile.h>
#include <HYDROData_Region.h>
+#include <HYDROData_Stream.h>
#include <HYDROData_Zone.h>
-#include <HYDROData_Obstacle.h>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
TopoDS_Face aZoneFace = TopoDS::Face( aZone->GetShape() );
- // Generate the filling color for zone
- QStringList aGeomObjectsNames;
-
- HYDROData_SequenceOfObjects aRefObjects = aZone->GetGeometryObjects();
- HYDROData_SequenceOfObjects::Iterator anIter( aRefObjects );
- for ( ; anIter.More(); anIter.Next() )
- {
- Handle(HYDROData_Object) aRefbject =
- Handle(HYDROData_Object)::DownCast( anIter.Value() );
- if ( aRefbject.IsNull() )
- continue;
-
- QString aRefObjectName = aRefbject->GetName();
- if ( aRefObjectName.isEmpty() )
- continue;
-
- aGeomObjectsNames.append( aRefObjectName );
- }
-
setFace( aZoneFace, false, false );
if (aZone->IsMergingNeed() && aZone->GetMergeType() == HYDROData_Zone::Merge_UNKNOWN )
{
}
else
{
+ // Generate the filling color for zone
+ QStringList aGeomObjectsNames;
+
+ HYDROData_SequenceOfObjects aRefObjects = aZone->GetGeometryObjects();
+ HYDROData_SequenceOfObjects::Iterator anIter( aRefObjects );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Object) aRefbject =
+ Handle(HYDROData_Object)::DownCast( anIter.Value() );
+ if ( aRefbject.IsNull() )
+ continue;
+
+ QString aRefObjectName = aRefbject->GetName();
+ if ( aRefObjectName.isEmpty() )
+ continue;
+
+ aGeomObjectsNames.append( aRefObjectName );
+ }
+
setFillingColor( HYDROGUI_Tool::GenerateFillingColor( aDocument, aGeomObjectsNames ) );
}
}
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 );
+
+ TopoDS_Wire aProfileWire;
+
+ if ( aProfile->IsValid() ) {
+ TopoDS_Shape aProfileShape = aProfile->GetShape3D();
+
+ if ( !aProfileShape.IsNull() &&
+ aProfileShape.ShapeType() == TopAbs_WIRE ) {
+ aProfileWire = TopoDS::Wire( aProfileShape );
+ }
+ }
+
+ setWire( aProfileWire, false, false );
+ }
+ else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Stream) ) )
+ {
+ Handle(HYDROData_Stream) aStream =
+ Handle(HYDROData_Stream)::DownCast( myObject );
+
+ TopoDS_Shell aStreamShape = TopoDS::Shell( aStream->GetTopShape() );
+
+ setShape( aStreamShape, false, false );
+ }
}
if ( myShape.IsNull() || !isVisible() )
// Erase previously created shape
erase();
- if ( myTopoShape.IsNull() )
+ if ( myTopoShape.IsNull() ) {
+ myShape.Nullify();
return;
+ }
QString aTextureFileName = getTextureFileName();
bool anIsTexture = !aTextureFileName.isEmpty();