X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_SWIG_WITHIHM%2FlibSMESH_Swig.h;h=24482f280655ba4bd23b2ab2804f6019334dceac;hb=f513b3c72c0c9c1a0c68bae34813cb41ac6fdcd5;hp=a288506a1b499431ef7a67393ff7cec3d840714d;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070;p=modules%2Fsmesh.git diff --git a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.h b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.h index a288506a1..24482f280 100644 --- a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.h +++ b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.h @@ -1,83 +1,215 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// SMESH SMESH : GUI for SMESH component -// File : libSMESH_Swig.h -// Author : Nicolas REJNERI, Open CASCADE S.A.S. +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef LIBSMESH_SWIG_H #define LIBSMESH_SWIG_H -#ifdef WNT -#if defined SMESH_SWIG_EXPORTS - #define SMESH_SWIG_EXPORT __declspec( dllexport ) +#ifdef WIN32 +#if defined SMESH_SWIG_EXPORTS || defined _libSMESH_Swig_EXPORTS + #define SMESH_SWIG_EXPORT __declspec(dllexport) #else - #define SMESH_SWIG_EXPORT __declspec( dllimport ) + #define SMESH_SWIG_EXPORT __declspec(dllimport) #endif #else #define SMESH_SWIG_EXPORT #endif -// IDL includes -#include -#include CORBA_SERVER_HEADER(SALOMEDS) +#include +#include + +// See SMESH_Actor.h +typedef enum +{ + EntityNone = 0x00, + Entity0d = 0x01, // SMESH_Actor::e0DElements + EntityEdges = 0x02, // SMESH_Actor::eEdges + EntityFaces = 0x04, // SMESH_Actor::eFaces + EntityVolumes = 0x08, // SMESH_Actor::eVolumes + EntityBalls = 0x10, // SMESH_Actor::eBallElem + EntityAll = 0xff // SMESH_Actor::eAllEntity +} EntityMode; + +// See SVTK_Selection.h +typedef enum +{ + Undefined = -1, + Node = NodeSelection, + Cell = CellSelection, + EdgeOfCell = EdgeOfCellSelection, + Edge = EdgeSelection, + Face = FaceSelection, + Volume = VolumeSelection, + Actor = ActorSelection, + Elem0D = Elem0DSelection, + Ball = BallSelection +} SelectionMode; + +// See SMESH_Actor.h +typedef enum +{ + UndefinedMode = -1, + PointMode = 0, // SMESH_Actor::ePoint + EdgeMode, // SMESH_Actor::eEdge + SurfaceMode // SMESH_Actor::eSurface +} DisplayMode; + +struct ColorData +{ + double r, g, b; +public: + ColorData(); +}; + +struct BicolorData +{ + double r, g, b; + int delta; +public: + BicolorData(); +}; + +struct Properties +{ + ColorData nodeColor; + int markerType; + int markerScale; + + ColorData edgeColor; + int edgeWidth; + + BicolorData surfaceColor; + BicolorData volumeColor; + + ColorData elem0dColor; + int elem0dSize; + + ColorData ballColor; + double ballScale; + + ColorData outlineColor; + int outlineWidth; + + ColorData orientationColor; + double orientationScale; + bool orientation3d; + + double shrinkFactor; + double opacity; + +public: + Properties(); +}; + +typedef ColorData nodeColorStruct; // deprecated +typedef ColorData edgeColorStruct; // deprecated +typedef BicolorData surfaceColorStruct; // deprecated +typedef BicolorData volumeColorStruct; // deprecated +typedef Properties actorAspect; // deprecated class SMESH_SWIG_EXPORT SMESH_Swig { public: SMESH_Swig(); ~SMESH_Swig(); - - void Init( int ); + + // Initialization ============================================= + + void Init(int); // deprecated + + // Publishing ================================================= + + const char* publish(const char*, const char* = 0); + void rename(const char*, const char*); + + const char* AddNewMesh(const char*, const char* = 0); // deprecated + const char* AddNewHypothesis(const char*, const char* = 0); // deprecated + const char* AddNewAlgorithm(const char*, const char* = 0); // deprecated + const char* AddNewAlgorithms(const char*, const char* = 0); // deprecated + + void SetShape(const char*, const char*); // deprecated + + void SetHypothesis(const char*, const char*); // deprecated + void SetAlgorithms(const char*, const char*); // deprecated - const char* AddNewMesh( const char* ); + void UnSetHypothesis(const char*); // deprecated - const char* AddNewHypothesis( const char* ); - const char* AddNewAlgorithms( const char* ); + const char* AddSubMesh(const char*, const char*, int, const char* = 0); // deprecated + const char* AddSubMeshOnShape(const char*, const char*, const char*, int, const char* = 0); // deprecated - void SetShape( const char*, const char* ); + void SetName(const char*, const char*); // deprecated - void SetHypothesis( const char*, const char* ); - void SetAlgorithms( const char*, const char* ); + void SetMeshIcon(const char*, const bool, const bool); // deprecated - void UnSetHypothesis( const char* ); + // Visualization ============================================= - const char* AddSubMesh( const char*, const char*, int ); - const char* AddSubMeshOnShape( const char*, const char*, const char*, int ); + void display(const char*, int = 0, bool = true); + void erase(const char*, int = 0, bool = true); + void update(const char*); - void CreateAndDisplayActor( const char* ); + Properties properties(const char*, int = 0); + void setProperties(const char*, const Properties&, int = 0); - void SetName( const char*, const char* ); + bool nodesNumbering(const char*, int = 0); + void setNodesNumbering(const char*, bool, int = 0); + bool elementsNumbering(const char*, int = 0); + void setElementsNumbering(const char*, bool, int = 0); - /*! - * \brief Set mesh icon according to compute status - * \param Mesh_Entry - entry of a mesh - * \param isComputed - is mesh computed or not - */ - void SetMeshIcon( const char*, const bool, const bool ); + DisplayMode displayMode(const char*, int = 0); + void setDisplayMode(const char*, DisplayMode, int = 0); + + bool shrinkMode(const char*, int = 0); + void setShrinkMode(const char*, bool, int = 0); + + double opacity(const char*, int = 0); + void setOpacity(const char*, double, int = 0); + + bool isOrientationShown(const char*, int = 0); + void setOrientationShown(const char*, bool, int = 0); + + int entitiesShown(const char*, int = 0); + void setEntitiesShown(const char*, int, int = 0); + bool isEntityShown(const char*, EntityMode, int = 0); + void setEntityShown(const char*, EntityMode, bool, int = 0); + + void CreateAndDisplayActor(const char*); // deprecated + void EraseActor(const char*, const bool = false); // deprecated + void UpdateActor(const char* Mesh_Entry); // deprecated + + actorAspect GetActorAspect(const char*, int = 0); // deprecated + void SetActorAspect(const actorAspect&, const char*, int = 0); // deprecated + + // Selection ================================================= + + SelectionMode getSelectionMode(int = 0); + void setSelectionMode(SelectionMode, int = 0); + std::vector getSelected(const char*); + std::vector > getSelectedEdgeOfCell(const char*); + + void select(const char*, std::vector, bool = false); + void select(const char*, int, bool = false); + void select(const char*, std::vector >, bool = false); + +private: + void init(); private: - SALOMEDS::Study_var myStudy; - SALOMEDS::StudyBuilder_var myStudyBuilder; - SALOMEDS::SComponent_var mySComponentMesh; + int myCachedStudyId; }; #endif // LIBSMESH_SWIG_H