// File generated by CPPExt (Transient)
//
//
//                     Copyright (C) 1991 - 2000 by  
//                      Matra Datavision SA.  All rights reserved.
//  
//                     Copyright (C) 2001 - 2004 by
//                     Open CASCADE SA.  All rights reserved.
// 
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//  
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.

#ifndef _MeshVS_Mesh_HeaderFile
#define _MeshVS_Mesh_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_MeshVS_Mesh_HeaderFile
#include <Handle_MeshVS_Mesh.hxx>
#endif

#ifndef _MeshVS_SequenceOfPrsBuilder_HeaderFile
#include <MeshVS_SequenceOfPrsBuilder.hxx>
#endif
#ifndef _Handle_MeshVS_PrsBuilder_HeaderFile
#include <Handle_MeshVS_PrsBuilder.hxx>
#endif
#ifndef _Handle_TColStd_HPackedMapOfInteger_HeaderFile
#include <Handle_TColStd_HPackedMapOfInteger.hxx>
#endif
#ifndef _MeshVS_DataMapOfIntegerOwner_HeaderFile
#include <MeshVS_DataMapOfIntegerOwner.hxx>
#endif
#ifndef _Handle_MeshVS_DataSource_HeaderFile
#include <Handle_MeshVS_DataSource.hxx>
#endif
#ifndef _Handle_MeshVS_Drawer_HeaderFile
#include <Handle_MeshVS_Drawer.hxx>
#endif
#ifndef _Handle_SelectMgr_EntityOwner_HeaderFile
#include <Handle_SelectMgr_EntityOwner.hxx>
#endif
#ifndef _MeshVS_MeshSelectionMethod_HeaderFile
#include <MeshVS_MeshSelectionMethod.hxx>
#endif
#ifndef _AIS_InteractiveObject_HeaderFile
#include <AIS_InteractiveObject.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_PrsMgr_PresentationManager3d_HeaderFile
#include <Handle_PrsMgr_PresentationManager3d.hxx>
#endif
#ifndef _Handle_Prs3d_Presentation_HeaderFile
#include <Handle_Prs3d_Presentation.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Handle_SelectMgr_Selection_HeaderFile
#include <Handle_SelectMgr_Selection.hxx>
#endif
#ifndef _Quantity_NameOfColor_HeaderFile
#include <Quantity_NameOfColor.hxx>
#endif
#ifndef _Standard_CString_HeaderFile
#include <Standard_CString.hxx>
#endif
class MeshVS_PrsBuilder;
class TColStd_HPackedMapOfInteger;
class MeshVS_DataSource;
class MeshVS_Drawer;
class SelectMgr_EntityOwner;
class PrsMgr_PresentationManager3d;
class Prs3d_Presentation;
class SelectMgr_Selection;
class SelectMgr_SequenceOfOwner;
class MeshVS_DataMapOfIntegerOwner;


//! the main class provides interface to create mesh presentation as a whole <br>
class MeshVS_Mesh : public AIS_InteractiveObject {

public:
 // Methods PUBLIC
 // 

//! Constructor. <br>
//! theIsAllowOverlapped is Standard_True, if it is allowed to draw edges overlapped with beams <br>
//!   Its value is stored in drawer <br>
Standard_EXPORT MeshVS_Mesh(const Standard_Boolean theIsAllowOverlapped = Standard_False);


Standard_EXPORT virtual  void Destroy() ;
~MeshVS_Mesh()
{
  Destroy();
}


//! Computes presentation using builders added to sequence. Each builder computes <br>
//! own part of mesh presentation according to its type. <br>
Standard_EXPORT virtual  void Compute(const Handle(PrsMgr_PresentationManager3d)& PM,const Handle(Prs3d_Presentation)& Prs,const Standard_Integer DisplayMode) ;

//! Computes selection according to SelectMode <br>
Standard_EXPORT virtual  void ComputeSelection(const Handle(SelectMgr_Selection)& Sel,const Standard_Integer SelectMode) ;

//! Draw selected owners presentation <br>
Standard_EXPORT virtual  void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& PM,const SelectMgr_SequenceOfOwner& Owners) ;

//! Draw hilighted owner presentation <br>
Standard_EXPORT virtual  void HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& PM,const Quantity_NameOfColor Color,const Handle(SelectMgr_EntityOwner)& Owner) ;

//! Clears internal selection presentation <br>
Standard_EXPORT virtual  void ClearSelected() ;

//! How many builders there are in sequence <br>
Standard_EXPORT   Standard_Integer GetBuildersCount() const;

//! Returns builder by its index in sequence <br>
Standard_EXPORT   Handle_MeshVS_PrsBuilder GetBuilder(const Standard_Integer Index) const;

//! Returns builder by its ID <br>
Standard_EXPORT   Handle_MeshVS_PrsBuilder GetBuilderById(const Standard_Integer Id) const;

//! Returns the smallest positive ID, not occupied by any builder. <br>
//! This method using when builder is created with ID = -1 <br>
Standard_EXPORT   Standard_Integer GetFreeId() const;

//! Adds builder to tale of sequence. <br>
//! PrsBuilder is builder to be added <br>
//! If TreatAsHilighter is true, MeshVS_Mesh will use this builder to create <br>
//! presentation of hilighted and selected owners. <br>
//!   Only one builder can be hilighter, so that if you call this method with <br>
//!   TreatAsHilighter = Standard_True some times, only last builder will be hilighter <br>
//!   WARNING: As minimum one builder must be added as hilighter, otherwise selection cannot be computed <br>
Standard_EXPORT   void AddBuilder(const Handle(MeshVS_PrsBuilder)& Builder,const Standard_Boolean TreatAsHilighter = Standard_False) ;

//! Changes hilighter ( see above ) <br>
Standard_EXPORT   void SetHilighter(const Handle(MeshVS_PrsBuilder)& Builder) ;

//! Sets builder with sequence index "Index" as hilighter <br>
Standard_EXPORT   Standard_Boolean SetHilighter(const Standard_Integer Index) ;

//! Sets builder with identificator "Id" as hilighter <br>
Standard_EXPORT   Standard_Boolean SetHilighterById(const Standard_Integer Id) ;

//! Returns hilighter <br>
Standard_EXPORT   Handle_MeshVS_PrsBuilder GetHilighter() const;

//! Removes builder from sequence. If it is hilighter, hilighter will be NULL <br>
//! ( Don't remember to set it to other after!!! ) <br>
Standard_EXPORT   void RemoveBuilder(const Standard_Integer Index) ;

//! Removes builder with identificator Id <br>
Standard_EXPORT   void RemoveBuilderById(const Standard_Integer Id) ;

//! Finds builder by its type the string represents <br>
Standard_EXPORT   Handle_MeshVS_PrsBuilder FindBuilder(const Standard_CString TypeString) const;

//! Returns map of owners. <br>
Standard_EXPORT  const MeshVS_DataMapOfIntegerOwner& GetOwnerMaps(const Standard_Boolean IsElement) ;

//! Returns default builders' data source <br>
Standard_EXPORT   Handle_MeshVS_DataSource GetDataSource() const;

//! Sets default builders' data source <br>
Standard_EXPORT   void SetDataSource(const Handle(MeshVS_DataSource)& aDataSource) ;

//! Returns default builders' drawer <br>
Standard_EXPORT   Handle_MeshVS_Drawer GetDrawer() const;

//! Sets default builders' drawer <br>
Standard_EXPORT   void SetDrawer(const Handle(MeshVS_Drawer)& aDrawer) ;

//! Returns True if specified element is hidden <br>
//!          By default no elements are hidden <br>
Standard_EXPORT   Standard_Boolean IsHiddenElem(const Standard_Integer ID) const;

//! Returns True if specified node is hidden. <br>
//!          By default all nodes are hidden <br>
Standard_EXPORT   Standard_Boolean IsHiddenNode(const Standard_Integer ID) const;

//! Returns True if specified element is not hidden <br>
Standard_EXPORT   Standard_Boolean IsSelectableElem(const Standard_Integer ID) const;

//! Returns True if specified node is specified as selectable. <br>
Standard_EXPORT   Standard_Boolean IsSelectableNode(const Standard_Integer ID) const;

//! Returns map of hidden nodes (may be null handle) <br>
Standard_EXPORT  const Handle_TColStd_HPackedMapOfInteger& GetHiddenNodes() const;

//! Sets map of hidden nodes, which shall not be displayed individually. <br>
//!          If nodes shared by some elements shall not be drawn, <br>
//!          they should be included into that map <br>
Standard_EXPORT   void SetHiddenNodes(const Handle(TColStd_HPackedMapOfInteger)& Ids) ;

//! Returns map of hidden elements (may be null handle) <br>
Standard_EXPORT  const Handle_TColStd_HPackedMapOfInteger& GetHiddenElems() const;

//! Sets map of hidden elements <br>
Standard_EXPORT   void SetHiddenElems(const Handle(TColStd_HPackedMapOfInteger)& Ids) ;

//! Returns map of selectable elements (may be null handle) <br>
Standard_EXPORT  const Handle_TColStd_HPackedMapOfInteger& GetSelectableNodes() const;

//! Sets map of selectable nodes. <br>
Standard_EXPORT   void SetSelectableNodes(const Handle(TColStd_HPackedMapOfInteger)& Ids) ;

//! Automatically computes selectable nodes; the node is considered <br>
//!          as being selectable if it is either not hidden, or is hidden <br>
//!          but referred by at least one non-hidden element. <br>
//!          Thus all nodes that are visible (either individually, or as ends or <br>
//!          corners of elements) are selectable by default. <br>
Standard_EXPORT   void UpdateSelectableNodes() ;

//! Returns set mesh selection method (see MeshVS.cdl) <br>
Standard_EXPORT   MeshVS_MeshSelectionMethod GetMeshSelMethod() const;

//! Sets mesh selection method (see MeshVS.cdl) <br>
Standard_EXPORT   void SetMeshSelMethod(const MeshVS_MeshSelectionMethod M) ;

//! Returns True if the given owner represents a whole mesh. <br>
Standard_EXPORT virtual  Standard_Boolean IsWholeMeshOwner(const Handle(SelectMgr_EntityOwner)& theOwner) const;


friend class MeshVS_PrsBuilder;


 // Type management
 //
 Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
 //Standard_EXPORT Standard_Boolean	       IsKind(const Handle(Standard_Type)&) const;

protected:

 // Methods PROTECTED
 // 


 // Fields PROTECTED
 //
MeshVS_DataMapOfIntegerOwner myNodeOwners;
MeshVS_DataMapOfIntegerOwner myElementOwners;
MeshVS_DataMapOfIntegerOwner my0DOwners;
MeshVS_DataMapOfIntegerOwner myLinkOwners;
MeshVS_DataMapOfIntegerOwner myFaceOwners;
MeshVS_DataMapOfIntegerOwner myVolumeOwners;
MeshVS_DataMapOfIntegerOwner myGroupOwners;
MeshVS_DataMapOfIntegerOwner myMeshOwners;
Handle_MeshVS_Drawer myCurrentDrawer;
Handle_MeshVS_Drawer mySelectionDrawer;
Handle_MeshVS_Drawer myHilightDrawer;
Handle_SelectMgr_EntityOwner myWholeMeshOwner;


private: 

 // Methods PRIVATE
 // 


 // Fields PRIVATE
 //
MeshVS_SequenceOfPrsBuilder myBuilders;
Handle_MeshVS_PrsBuilder myHilighter;
Handle_TColStd_HPackedMapOfInteger myHiddenElements;
Handle_TColStd_HPackedMapOfInteger myHiddenNodes;
Handle_TColStd_HPackedMapOfInteger mySelectableNodes;
Handle_MeshVS_DataSource myDataSource;
MeshVS_MeshSelectionMethod mySelectionMethod;


};





// other Inline functions and methods (like "C++: function call" methods)
//


#endif
