Salome HOME
Refs #289 - Spline profile is represented in OCC view as polyline profile
[modules/hydro.git] / src / HYDROPy / HYDROData_Object.sip
index feb7aca2297ea58fea49ff4b6f2907b8fe5dc5ea..0f128fb142466da9182e7aef6f138d24b840c01b 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-
 %ExportedHeaderCode
 #include <HYDROData_Object.h>
 %End
 
-typedef int ObjectKind;
-
-class HYDROData_Object
+class HYDROData_Object : HYDROData_Entity /Abstract/
 {
 %TypeHeaderCode
 #include <HYDROData_Object.h>
 %End
 
 %ConvertToSubClassCode
-    // HYDROData_Object sub-classes provide a unique kind ID.
-    switch ( sipCpp->GetKind() )
+    if ( !Handle(HYDROData_ArtificialObject)::DownCast( sipCpp ).IsNull() )
+      sipClass = sipClass_HYDROData_ArtificialObject;
+    else if ( !Handle(HYDROData_NaturalObject)::DownCast( sipCpp ).IsNull() )
+      sipClass = sipClass_HYDROData_NaturalObject;
+    else
     {
-      case KIND_IMAGE:
-        sipClass = sipClass_HYDROData_Image;
-        break;
-
-      case KIND_BATHYMETRY:
-        sipClass = sipClass_HYDROData_Bathymetry;
-        break;
-
-      case KIND_UNKNOWN:
-        sipClass = sipClass_HYDROData_Object;
-        break;
-
-      default:
-        // We don't recognise the type.
-        sipClass = NULL;
+      // HYDROData_Object sub-classes provide a unique kind ID.
+      switch ( sipCpp->GetKind() )
+      {
+        case KIND_OBSTACLE:
+          sipClass = sipClass_HYDROData_Obstacle;
+          break;
+
+        case KIND_UNKNOWN:
+          sipClass = sipClass_HYDROData_Object;
+          break;
+
+        default:
+          // We don't recognise the type.
+          sipClass = NULL;
+      }
     }
 %End
 
 public:
-  /**
-   * Visual state data.
-   */
-  struct VisualState
-  {
-    bool Visibility;
-    double Transparency;
-    double ZValue;
-
-    VisualState();
-  };
-  
-  typedef QMap        < int, HYDROData_Object::VisualState > ViewId2VisualStateMap;
-  typedef QMapIterator< int, HYDROData_Object::VisualState > ViewId2VisualStateMapIterator;
-
-public:
-
-  /**
-   * Returns the kind of this object. Must be redefined in all objects of known type.
-   */
-  const ObjectKind GetKind() const;
-
-  /**
-   * Returns the name of this object.
-   */
-  QString GetName() const;
-
-  /**
-   * Updates the name of this object.
-   */
-  void SetName(const QString& theName);
-
-  /**
-   * Returns the object visibility state for the view with specified id.
-   * \param theViewId view id
-   * \returns visibility state
-   */
-  bool IsVisible( const int theViewId ) const;
 
   /**
-   * Sets the object visibility state for the view with specified id.
-   * \param theViewId view id
-   * \param theVal visibility state
+   * Set reference altitude object for geometry object.
    */
-  void SetVisible( const int theViewId,
-                   const bool theVal );
+  bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) [void (const Handle_HYDROData_IAltitudeObject&)];
+  %MethodCode
 
-  /**
-   * Checks is object exists in the data structure.
-   * \returns true is object is not exists in the data model
-   */
-  bool IsRemoved() const;
+    Handle(HYDROData_IAltitudeObject) aRefAltitude =
+      Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) );
+    if ( !aRefAltitude.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipRes = sipSelfWasArg ? sipCpp->HYDROData_Object::SetAltitudeObject( aRefAltitude ) : 
+                               sipCpp->SetAltitudeObject( aRefAltitude );
+      Py_END_ALLOW_THREADS
+    }
 
-  /**
-   * Removes object from the data structure.
-   */
-  void Remove();
+  %End
 
   /**
-   * Returns unique integer identifier of the object (may be used for ordering of objects)
+   * Returns reference altitude object of geometry object.
    */
-  int ID() const;
+  HYDROData_IAltitudeObject GetAltitudeObject() const [Handle_HYDROData_IAltitudeObject ()];
+  %MethodCode
+
+    Handle(HYDROData_IAltitudeObject) aRefAltitude;
+    
+    Py_BEGIN_ALLOW_THREADS
+    aRefAltitude = sipSelfWasArg ? sipCpp->HYDROData_Object::GetAltitudeObject() : 
+                                   sipCpp->GetAltitudeObject();
+    Py_END_ALLOW_THREADS
+    
+    sipRes = (HYDROData_IAltitudeObject*)createPointer( aRefAltitude );
+  
+  %End
 
   /**
-   * Copies all properties of this to the destinated object.
-   * Objects must be the same type.
-   * \param theDestination initialized object (from any document) - target of copying
+   * Clear the reference altitude object for geometry object.
    */
-  /*
-  void CopyTo( HYDROData_Object theDestination ) const;
-  */
+  void RemoveAltitudeObject();
 
 protected: