1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
occt/src/MeshVS/MeshVS_MeshEntityOwner.cxx
kgv d6c489212b 0028990: Coding Rules - deprecate redundant class Prs3d_Root
Prs3d_Root usage has been replaced by direct calls to Prs3d_Presentation methods.
2020-08-30 19:04:53 +03:00

135 lines
4.6 KiB
C++

// Created on: 2003-09-09
// Created by: Alexander SOLOVYOV
// Copyright (c) 2003-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_Group.hxx>
#include <MeshVS_Mesh.hxx>
#include <MeshVS_MeshEntityOwner.hxx>
#include <PrsMgr_PresentationManager.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <SelectMgr_SelectableObject.hxx>
#include <Standard_Type.hxx>
#include <TColStd_ListIteratorOfListOfReal.hxx>
IMPLEMENT_STANDARD_RTTIEXT(MeshVS_MeshEntityOwner,SelectMgr_EntityOwner)
#ifndef MeshVS_PRSBUILDERHXX
#include <MeshVS_PrsBuilder.hxx>
#endif
//================================================================
// Function : Constructor MeshVS_MeshEntityOwner
// Purpose :
//================================================================
MeshVS_MeshEntityOwner::MeshVS_MeshEntityOwner
( const SelectMgr_SelectableObject* SelObj,
const Standard_Integer ID,
const Standard_Address MeshEntity,
const MeshVS_EntityType& Type,
const Standard_Integer Priority,
const Standard_Boolean IsGroup )
: SelectMgr_EntityOwner ( SelObj, Priority ),
myAddr ( MeshEntity ),
myType ( Type ),
myID ( ID ),
myIsGroup ( IsGroup )
{
//
}
//================================================================
// Function : Owner
// Purpose :
//================================================================
Standard_Address MeshVS_MeshEntityOwner::Owner() const
{
return myAddr;
}
//================================================================
// Function : Type
// Purpose :
//================================================================
MeshVS_EntityType MeshVS_MeshEntityOwner::Type() const
{
return myType;
}
//================================================================
// Function : IsGroup
// Purpose :
//================================================================
Standard_Boolean MeshVS_MeshEntityOwner::IsGroup() const
{
return myIsGroup;
}
//================================================================
// Function : IsHilighted
// Purpose :
//================================================================
Standard_Boolean MeshVS_MeshEntityOwner::IsHilighted ( const Handle(PrsMgr_PresentationManager)&,
const Standard_Integer ) const
{
return Standard_False;
}
//================================================================
// Function : HilightWithColor
// Purpose :
//================================================================
void MeshVS_MeshEntityOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer /*theMode*/ )
{
Handle( SelectMgr_SelectableObject ) aSelObj;
if ( HasSelectable() )
aSelObj = Selectable();
if ( thePM->IsImmediateModeOn() && aSelObj->IsKind( STANDARD_TYPE( MeshVS_Mesh ) ) )
{
Handle( MeshVS_Mesh ) aMesh = Handle( MeshVS_Mesh )::DownCast ( aSelObj );
aMesh->HilightOwnerWithColor ( thePM, theStyle, this );
}
}
//================================================================
// Function : Unhilight
// Purpose :
//================================================================
void MeshVS_MeshEntityOwner::Unhilight ( const Handle(PrsMgr_PresentationManager)&,
const Standard_Integer )
{
}
//================================================================
// Function : Clear
// Purpose :
//================================================================
void MeshVS_MeshEntityOwner::Clear ( const Handle(PrsMgr_PresentationManager)&,
const Standard_Integer )
{
}
//================================================================
// Function : ID
// Purpose :
//================================================================
Standard_Integer MeshVS_MeshEntityOwner::ID () const
{
return myID;
}