#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_MaterialAspect.hxx>
+#include <HYDROData_Channel.h>
#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 <HYDROData_Profile.h>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
HYDROGUI_Shape::~HYDROGUI_Shape()
{
- erase();
+ erase( false );
if ( !myShape.IsNull() )
myShape.Nullify();
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 ) );
}
}
Handle(HYDROData_Profile) aProfile =
Handle(HYDROData_Profile)::DownCast( myObject );
+ TopoDS_Wire aProfileWire;
+
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 ( !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 );
+
+ QColor aFillingColor = aStream->GetFillingColor();
+ QColor aBorderColor = aStream->GetBorderColor();
+
+ setFillingColor( aFillingColor, false, false );
+ setBorderColor( aBorderColor, false, false );
+ }
+ else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Channel) ) )
+ {
+ Handle(HYDROData_Channel) aChannel =
+ Handle(HYDROData_Channel)::DownCast( myObject );
+
+ TopoDS_Face aChannelShape = TopoDS::Face( aChannel->GetTopShape() );
+
+ setShape( aChannelShape, false, false );
+
+ QColor aFillingColor = aChannel->GetFillingColor();
+ QColor aBorderColor = aChannel->GetBorderColor();
+
+ setFillingColor( aFillingColor, false, false );
+ setBorderColor( aBorderColor, false, false );
}
}
// Erase previously created shape
erase();
- if ( myTopoShape.IsNull() )
+ if ( myTopoShape.IsNull() ) {
+ myShape.Nullify();
return;
+ }
QString aTextureFileName = getTextureFileName();
bool anIsTexture = !aTextureFileName.isEmpty();
const Handle(AIS_Drawer)& anAttributes = myShape->Attributes();
if ( !anAttributes.IsNull() )
{
- if ( myDisplayMode == AIS_Shaded )
- {
- Handle(Prs3d_IsoAspect) anIsoAspect = anAttributes->UIsoAspect();
- if ( !anIsoAspect.IsNull() )
- anIsoAspect->SetNumber( 0 );
+ Handle(Prs3d_IsoAspect) anIsoAspect = anAttributes->UIsoAspect();
+ if ( !anIsoAspect.IsNull() ) {
+ anIsoAspect->SetNumber( 0 );
+ anAttributes->SetUIsoAspect( anIsoAspect );
+ }
- anIsoAspect = anAttributes->VIsoAspect();
- if ( !anIsoAspect.IsNull() )
- anIsoAspect->SetNumber( 0 );
+ anIsoAspect = anAttributes->VIsoAspect();
+ if ( !anIsoAspect.IsNull() ) {
+ anIsoAspect->SetNumber( 0 );
+ anAttributes->SetVIsoAspect( anIsoAspect );
+ }
+ if ( myDisplayMode == AIS_Shaded )
+ {
Handle(Prs3d_ShadingAspect) aShadingAspect = anAttributes->ShadingAspect();
if ( !aShadingAspect.IsNull() )
{