0024624: Lost word in license statement in source files
[occt.git] / src / AIS / AIS_InteractiveContext_3.cxx
CommitLineData
b311480e 1// Created on: 2001-01-09
2// Created by: Sergey Altukhov
973c2be1 3// Copyright (c) 2001-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
16// Modified: 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
17
18#include <AIS_InteractiveContext.jxx>
19// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
20#include <AIS_GlobalStatus.hxx>
21// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
22
7fd59977 23// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
24
25//=======================================================================
26//function : SetPolygonOffsets
27//purpose :
28//=======================================================================
29void AIS_InteractiveContext::SetPolygonOffsets(
30 const Handle(AIS_InteractiveObject)& anObj,
31 const Standard_Integer aMode,
60be1f9b 32 const Standard_ShortReal aFactor,
33 const Standard_ShortReal aUnits,
7fd59977 34 const Standard_Boolean updateviewer)
35{
36 if ( anObj.IsNull() )
37 return;
38
39 if( !anObj->HasInteractiveContext() )
40 anObj->SetContext( this );
41
42 anObj->SetPolygonOffsets( aMode, aFactor, aUnits );
43
44 if ( updateviewer ) {
45 if( myObjects.IsBound( anObj ) ) {
46 Handle(AIS_GlobalStatus) STATUS = myObjects(anObj);
47 if ( STATUS->GraphicStatus() == AIS_DS_Displayed )
48 myMainVwr->Update();
49 }
50 }
51}
52
53
54//=======================================================================
55//function : HasPolygonOffsets
56//purpose :
57//=======================================================================
58Standard_Boolean AIS_InteractiveContext::HasPolygonOffsets(const Handle(AIS_InteractiveObject)& anObj) const
59{
60 return ( !anObj.IsNull() && anObj->HasPolygonOffsets() );
61}
62
63//=======================================================================
64//function : PolygonOffsets
65//purpose :
66//=======================================================================
67void AIS_InteractiveContext::PolygonOffsets(
68 const Handle(AIS_InteractiveObject)& anObj,
69 Standard_Integer& aMode,
60be1f9b 70 Standard_ShortReal& aFactor,
71 Standard_ShortReal& aUnits) const
7fd59977 72{
73 if ( HasPolygonOffsets( anObj ) )
74 anObj->PolygonOffsets( aMode, aFactor, aUnits );
75}
76// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets