return aResSeq;
}
-TopoDS_Shape HYDROData_Channel::GetTopShape() const
-{
- return getTopShape();
-}
-
-TopoDS_Shape HYDROData_Channel::GetShape3D() const
-{
- return getShape3D();
-}
-
bool HYDROData_Channel::CreatePresentations( const Handle(HYDROData_Polyline3D)& theGuideLine,
const Handle(HYDROData_Profile)& theProfile,
PrsDefinition& thePrs )
*/
HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
- /**
- * Returns the top shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
-
- /**
- * Returns the 3d shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
-
/**
* Returns the left edge of the channel.
*/
return aResList;
}
-TopoDS_Shape HYDROData_Confluence::GetTopShape() const
-{
- // TODO
- return getTopShape();
-}
-
-TopoDS_Shape HYDROData_Confluence::GetShape3D() const
-{
- // TODO
- return getShape3D();
-}
-
void HYDROData_Confluence::UpdateLocalCS( double theDx, double theDy )
{
//TODO
*/
HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
- /**
- * Returns the top shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
-
- /**
- * Returns the 3d shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
-
HYDRODATA_EXPORT virtual void UpdateLocalCS( double theDx, double theDy );
protected:
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "HYDROData_Entity.h"
-
-#include "HYDROData_Iterator.h"
-#include "HYDROData_Tool.h"
-
+#include <HYDROData_Entity.h>
+#include <HYDROData_Document.h>
+#include <HYDROData_Iterator.h>
+#include <HYDROData_Tool.h>
+#include <Standard_GUID.hxx>
#include <TDataStd_Name.hxx>
#include <TDataStd_ByteArray.hxx>
#include <TDataStd_UAttribute.hxx>
-#include <TDataStd_IntegerArray.hxx>
-#include <TDataStd_BooleanArray.hxx>
#include <TDataStd_Integer.hxx>
-#include <TDataStd_RealArray.hxx>
+#include <TDataStd_IntegerArray.hxx>
#include <TDataStd_ReferenceList.hxx>
-
#include <TDF_CopyLabel.hxx>
#include <TDF_ListIteratorOfLabelList.hxx>
-
+#include <TNaming_Builder.hxx>
+#include <TNaming_NamedShape.hxx>
+#include <TopoDS_Shape.hxx>
#include <QColor>
-#include <QString>
+#include <QRegExp>
#include <QStringList>
#include <QVariant>
.arg( aDocument->GetDocPyName() )
.arg( GetName() );
}
+
+void HYDROData_Entity::SetShape( int theTag, const TopoDS_Shape& theShape )
+{
+ TNaming_Builder aBuilder( myLab.FindChild( theTag ) );
+ aBuilder.Generated( theShape );
+}
+
+TopoDS_Shape HYDROData_Entity::GetShape( int theTag ) const
+{
+ TDF_Label aShapeLabel = myLab.FindChild( theTag, false );
+ if ( !aShapeLabel.IsNull() )
+ {
+ Handle(TNaming_NamedShape) aNamedShape;
+ if ( aShapeLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
+ return aNamedShape->Get();
+ }
+ return TopoDS_Shape();
+}
#define HYDROData_Entity_HeaderFile
#include "HYDROData.h"
-
#include <NCollection_Sequence.hxx>
-
#include <TDF_Label.hxx>
-
#include <QMap>
class QColor;
class QStringList;
class Handle(TDataStd_ReferenceList);
class Handle_HYDROData_Entity;
+class TopoDS_Shape;
///! Kind of an object in a document
typedef int ObjectKind;
Handle(TDataStd_ReferenceList) getReferenceList( const int theTag,
const bool theIsCreate ) const;
-
+
+ void SetShape( int theTag, const TopoDS_Shape& theShape );
+ TopoDS_Shape GetShape( int theTag ) const;
protected:
/// Array of pointers to the properties of this object; index in this array is returned by \a AddProperty.
#include <TDataStd_ExtStringList.hxx>
#include <TDataStd_IntegerList.hxx>
#include <TDataStd_RealList.hxx>
-
#include <TopoDS_Shape.hxx>
-
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
-
#include <QColor>
IMPLEMENT_STANDARD_HANDLE(HYDROData_IPolyline, HYDROData_Entity)
return GetPoints( theSectionIndex ).Length();
}
-TopoDS_Shape HYDROData_IPolyline::getPolylineShape() const
+TopoDS_Shape HYDROData_IPolyline::GetShape() const
{
- TDF_Label aShapeLabel = myLab.FindChild( DataTag_PolylineShape, false );
- if ( !aShapeLabel.IsNull() )
- {
- Handle(TNaming_NamedShape) aNamedShape;
- if ( aShapeLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
- return aNamedShape->Get();
- }
- return TopoDS_Shape();
+ return HYDROData_Entity::GetShape( DataTag_PolylineShape );
}
-void HYDROData_IPolyline::setPolylineShape( const TopoDS_Shape& theShape )
+void HYDROData_IPolyline::SetShape( const TopoDS_Shape& theShape )
{
- TNaming_Builder aBuilder( myLab.FindChild( DataTag_PolylineShape ) );
- aBuilder.Generated( theShape );
+ HYDROData_Entity::SetShape( DataTag_PolylineShape, theShape );
}
-void HYDROData_IPolyline::removePolylineShape()
+void HYDROData_IPolyline::RemovePolylineShape()
{
- TDF_Label aShapeLabel = myLab.FindChild( DataTag_PolylineShape, false );
- if ( !aShapeLabel.IsNull() )
- aShapeLabel.ForgetAllAttributes();
+ SetShape( TopoDS_Shape() );
}
void HYDROData_IPolyline::getSectionsLists( Handle(TDataStd_ExtStringList)& theNamesList,
HYDRODATA_EXPORT static QColor DefaultWireColor();
public:
-
- /**
- * Returns the 3D presentation of all points.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const = 0;
-
-
/**
* Returns number of sections.
*/
*/
HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const = 0;
-protected:
-
- TopoDS_Shape getPolylineShape() const;
-
- void setPolylineShape( const TopoDS_Shape& theShape );
-
- void removePolylineShape();
+ TopoDS_Shape GetShape() const;
+ void SetShape( const TopoDS_Shape& theShape );
+protected:
+ void RemovePolylineShape();
void getSectionsLists( Handle(TDataStd_ExtStringList)& theNamesList,
Handle(TDataStd_IntegerList)& theTypesList,
return aResSeq;
}
-TopoDS_Shape HYDROData_ImmersibleZone::GetTopShape() const
-{
- return getTopShape();
-}
-
void HYDROData_ImmersibleZone::Update()
{
HYDROData_NaturalObject::Update();
TopoDS_Shape HYDROData_ImmersibleZone::GetShape3D() const
{
- return getTopShape();
+ return GetTopShape();
}
QColor HYDROData_ImmersibleZone::DefaultFillingColor()
*/
HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
- /**
- * Returns the top shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
-
/**
* Returns the 3d shape of the object.
*/
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <TDataStd_AsciiString.hxx>
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
TCollection_AsciiString anErrorMsg;
TopoDS_Shape aResShape = buildShape( GetPolylines(), anErrorMsg );
- setShape( aResShape );
+ SetShape( aResShape );
}
void HYDROData_LandCover::SetPolylines( const HYDROData_SequenceOfObjects& thePolylines )
TopoDS_Shape HYDROData_LandCover::GetShape() const
{
- TopoDS_Shape aShape;
-
- TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false );
- if ( !aLabel.IsNull() )
- {
- Handle(TNaming_NamedShape) aNamedShape;
- if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) {
- aShape = aNamedShape->Get();
- }
- }
-
- return aShape;
+ return HYDROData_Entity::GetShape( DataTag_Shape );
}
void HYDROData_LandCover::SetFillingColor( const QColor& theColor )
return QColor( Qt::transparent );
}
-void HYDROData_LandCover::setShape( const TopoDS_Shape& theShape )
+void HYDROData_LandCover::SetShape( const TopoDS_Shape& theShape )
{
- TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape ) );
- aBuilder.Generated( theShape );
+ HYDROData_Entity::SetShape( DataTag_Shape, theShape );
}
void HYDROData_LandCover::removeShape()
/**
* Sets the shape presentation of the land cover.
*/
- HYDRODATA_EXPORT virtual void setShape( const TopoDS_Shape& theShape );
+ HYDRODATA_EXPORT virtual void SetShape( const TopoDS_Shape& theShape );
protected:
#include <BRepAlgoAPI_Fuse.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <NCollection_IndexedMap.hxx>
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Face.hxx>
*/
TopoDS_Shape HYDROData_LandCoverMap::GetShape() const
{
- TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false );
- if ( !aLabel.IsNull() )
- {
- Handle(TNaming_NamedShape) aNamedShape;
- if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
- return aNamedShape->Get();
- }
- return TopoDS_Shape();
+ return HYDROData_Entity::GetShape( DataTag_Shape );
}
/**
*/
void HYDROData_LandCoverMap::SetShape( const TopoDS_Shape& theShape )
{
- TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape ) );
- aBuilder.Generated( theShape );
+ HYDROData_Entity::SetShape( DataTag_Shape, theShape );
}
/**
#include "HYDROData_Tool.h"
#include "HYDROData_Iterator.h"
#include "HYDROData_IAltitudeObject.h"
-
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
-
#include <TopoDS_Shape.hxx>
#include <TDataStd_Integer.hxx>
void HYDROData_Object::Update()
{
- removeTopShape();
- removeShape3D();
- removeGroupObjects();
+ RemoveTopShape();
+ RemoveShape3D();
+ RemoveGroupObjects();
checkAndSetAltitudeObject();
HYDROData_Entity::Update();
}
void HYDROData_Object::SetTopShape( const TopoDS_Shape& theShape )
{
- TNaming_Builder aBuilder( myLab.FindChild( DataTag_TopShape ) );
- aBuilder.Generated( theShape );
+ HYDROData_Entity::SetShape( DataTag_TopShape, theShape );
+}
+
+TopoDS_Shape HYDROData_Object::GetTopShape() const
+{
+ return HYDROData_Entity::GetShape( DataTag_TopShape );
}
void HYDROData_Object::SetShape3D( const TopoDS_Shape& theShape )
{
- TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape3D ) );
- aBuilder.Generated( theShape );
-
+ HYDROData_Entity::SetShape( DataTag_Shape3D, theShape );
// Check the object 3D existance
checkAndSetObject3D();
}
+TopoDS_Shape HYDROData_Object::GetShape3D() const
+{
+ return HYDROData_Entity::GetShape( DataTag_Shape3D );
+}
+
Handle(HYDROData_DummyObject3D) HYDROData_Object::GetObject3D() const
{
Handle(HYDROData_DummyObject3D) anObject;
return aNewGroup;
}
-void HYDROData_Object::removeGroupObjects()
+void HYDROData_Object::RemoveGroupObjects()
{
TDF_Label aLabel = myLab.FindChild( DataTag_EdgesGroup, false );
if ( !aLabel.IsNull() )
aLabel.ForgetAllAttributes();
}
-TopoDS_Shape HYDROData_Object::getTopShape() const
+void HYDROData_Object::RemoveTopShape()
{
- TDF_Label aLabel = myLab.FindChild( DataTag_TopShape, false );
- if ( !aLabel.IsNull() )
- {
- Handle(TNaming_NamedShape) aNamedShape;
- if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
- return aNamedShape->Get();
- }
-
- return TopoDS_Shape();
+ HYDROData_Entity::SetShape( DataTag_TopShape, TopoDS_Shape() );
}
-void HYDROData_Object::removeTopShape()
+void HYDROData_Object::RemoveShape3D()
{
- TDF_Label aLabel = myLab.FindChild( DataTag_TopShape, false );
- if ( !aLabel.IsNull() )
- aLabel.ForgetAllAttributes();
-}
-
-TopoDS_Shape HYDROData_Object::getShape3D() const
-{
- TDF_Label aLabel = myLab.FindChild( DataTag_Shape3D, false );
- if ( !aLabel.IsNull() )
- {
- Handle(TNaming_NamedShape) aNamedShape;
- if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
- return aNamedShape->Get();
- }
-
- return TopoDS_Shape();
-}
-
-void HYDROData_Object::removeShape3D()
-{
- TDF_Label aLabel = myLab.FindChild( DataTag_Shape3D, false );
- if ( !aLabel.IsNull() )
- aLabel.ForgetAllAttributes();
+ HYDROData_Entity::SetShape( DataTag_Shape3D, TopoDS_Shape() );
}
bool HYDROData_Object::IsSubmersible() const
/**
* Returns the top shape of the object.
*/
- HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const = 0;
+ HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
/**
* Sets the 3d shape of the object.
/**
* Returns the 3d shape of the object.
*/
- HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const = 0;
+ HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
-
/**
* Returns reference object which represent the 3D shape of object.
*/
/**
* Remove all child group objects.
*/
- HYDRODATA_EXPORT virtual void removeGroupObjects();
-
-
- /**
- * Retrieve the top shape of the object from data label.
- */
- HYDRODATA_EXPORT TopoDS_Shape getTopShape() const;
+ HYDRODATA_EXPORT virtual void RemoveGroupObjects();
/**
* Removes the top shape from data label of the object.
*/
- HYDRODATA_EXPORT void removeTopShape();
-
-
- /**
- * Retrieve the 3d shape of the object from data label.
- */
- HYDRODATA_EXPORT TopoDS_Shape getShape3D() const;
+ HYDRODATA_EXPORT void RemoveTopShape();
/**
* Removes the 3d shape from data label of the object.
*/
- HYDRODATA_EXPORT void removeShape3D();
+ HYDRODATA_EXPORT void RemoveShape3D();
};
#endif
void HYDROData_Obstacle::Update()
{
- removeGroupObjects();
+ RemoveGroupObjects();
createGroupObjects();
checkAndSetAltitudeObject();
return true;
}
-TopoDS_Shape HYDROData_Obstacle::GetTopShape() const
-{
- return getTopShape();
-}
-
-TopoDS_Shape HYDROData_Obstacle::GetShape3D() const
-{
- return getShape3D();
-}
-
void HYDROData_Obstacle::SetShape3D( const TopoDS_Shape& theShape )
{
TopoDS_Face aShape2d = HYDROData_Projection::MakeProjection( theShape );
*/
HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
- /**
- * Returns the top shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
-
- /**
- * Returns the 3d shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
-
/**
* Returns default filling color for new obstacle.
*/
return aResSeq;
}
-TopoDS_Shape HYDROData_Polyline3D::GetTopShape() const
-{
- return getTopShape();
-}
-
-TopoDS_Shape HYDROData_Polyline3D::GetShape3D() const
-{
- return getShape3D();
-}
-
void HYDROData_Polyline3D::Update()
{
HYDROData_Object::Update();
*/
HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
- /**
- * Returns the top shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
-
- /**
- * Returns the 3d shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
-
/**
* Update the shape presentations of stream.
* Call this method whenever you made changes for stream data.
return aRes;
}
-TopoDS_Shape HYDROData_PolylineXY::GetShape() const
-{
- return getPolylineShape();
-}
-
-bool HYDROData_PolylineXY::SetShape( const TopoDS_Shape& theShape )
-{
- setPolylineShape( theShape );
- return true;
-}
-
bool convertEdgeToSection( const TopoDS_Edge& theEdge,
NCollection_Sequence<TCollection_AsciiString>& theSectNames,
NCollection_Sequence<HYDROData_PolylineXY::SectionType>& theSectTypes,
if( aProj.IsDone() )
aResult = aProj.Shape();
- setPolylineShape( aResult );
+ SetShape( aResult );
}
setEditable( anIsCanBeImported );
aResult = mkWire.Wire();
}
- setPolylineShape( aResult );
+ SetShape( aResult );
}
bool HYDROData_PolylineXY::IsHas2dPrs() const
bool HYDROData_PolylineXY::IsCustom() const
{
- bool isNull = getPolylineShape().IsNull();
+ bool isNull = GetShape().IsNull();
int aNbPoints = 0;
//TODO: to check if there is no points
public:
- /**
- * Returns the 2D presentation of all points.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
- HYDRODATA_EXPORT bool SetShape( const TopoDS_Shape& theShape );
-
/**
* Returns the 3D presentation of all points.
*/
TopoDS_Shape HYDROData_Profile::GetShape3D() const
{
- TopoDS_Shape aShape = getShape3D();
+ TopoDS_Shape aShape = HYDROData_Object::GetShape3D();
if( aShape.IsNull() )
aShape = CreateProfileWire( true );
return aShape;
return true;
}
-TopoDS_Shape HYDROData_River::GetTopShape() const
-{
- // TODO
- return getTopShape();
-}
-
-TopoDS_Shape HYDROData_River::GetShape3D() const
-{
- // TODO
- return getShape3D();
-}
-
void HYDROData_River::UpdateLocalCS( double theDx, double theDy )
{
//TODO
*/
HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
- /**
- * Returns the top shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
-
- /**
- * Returns the 3d shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
-
protected:
friend class HYDROData_Iterator;
//
#include "HYDROData_ShapesGroup.h"
-
#include "HYDROData_ShapesTool.h"
+#include <BRepBuilderAPI_MakeShape.hxx>
#include <TDF_ChildIDIterator.hxx>
+#include <TNaming_Builder.hxx>
+#include <TNaming_NamedShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
-
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
-
-#include <BRepBuilderAPI_MakeShape.hxx>
-
#include <ShapeUpgrade_UnifySameDomain.hxx>
IMPLEMENT_STANDARD_HANDLE(HYDROData_ShapesGroup,HYDROData_Entity)
return aResSeq;
}
-TopoDS_Shape HYDROData_Stream::GetTopShape() const
-{
- return getTopShape();
-}
-
-TopoDS_Shape HYDROData_Stream::GetShape3D() const
-{
- return getShape3D();
-}
-
Handle(Geom_BSplineCurve) HYDROData_Stream::buildInterpolationCurve(
const Handle(TColgp_HArray1OfPnt)& theArrayOfPnt )
{
*/
HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
- /**
- * Returns the top shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
-
- /**
- * Returns the 3d shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
-
/**
* Update the profiles order and shape presentations of stream.
* Call this method whenever you made changes for stream data.
#include "HYDROData_Document.h"
#include "HYDROData_NaturalObject.h"
#include "HYDROData_LandCover.h"
-
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
-
-#include <TopoDS_Shape.hxx>
-
#include <QStringList>
-
#include <TDataStd_Integer.hxx>
+#include <TopoDS_Shape.hxx>
IMPLEMENT_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Entity)
void HYDROData_Zone::SetShape( const TopoDS_Shape& theShape )
{
- TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape ) );
- aBuilder.Generated( theShape );
+ HYDROData_Entity::SetShape( DataTag_Shape, theShape );
}
TopoDS_Shape HYDROData_Zone::GetShape() const
{
- TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false );
- if ( !aLabel.IsNull() )
- {
- Handle(TNaming_NamedShape) aNamedShape;
- if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
- return aNamedShape->Get();
- }
-
- return TopoDS_Shape();
+ return HYDROData_Entity::GetShape( DataTag_Shape );
}
bool HYDROData_Zone::IsMergingNeed() const
aLC->SetFillingColor( HYDROData_LandCover::DefaultFillingColor() );
aLC->SetBorderColor( HYDROData_LandCover::DefaultBorderColor() );
- aLC->setShape(aResShape);
+ aLC->SetShape(aResShape);
aLC->Show();
//erasePreview();
{
TopoDS_Face aFace = TopoDS::Face(aFaces.Value( i ));
- aLC->setShape( aFace );
+ aLC->SetShape( aFace );
if ( aViewManager && !aCtx.IsNull() )
{