1 // Created on: 2001-01-09
2 // Created by: Sergey Altukhov
3 // Copyright (c) 2001-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
21 // Modified: 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
23 #include <AIS_InteractiveContext.jxx>
24 // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
25 #include <AIS_GlobalStatus.hxx>
26 // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
28 // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
30 //=======================================================================
31 //function : SetPolygonOffsets
33 //=======================================================================
34 void AIS_InteractiveContext::SetPolygonOffsets(
35 const Handle(AIS_InteractiveObject)& anObj,
36 const Standard_Integer aMode,
37 const Standard_ShortReal aFactor,
38 const Standard_ShortReal aUnits,
39 const Standard_Boolean updateviewer)
44 if( !anObj->HasInteractiveContext() )
45 anObj->SetContext( this );
47 anObj->SetPolygonOffsets( aMode, aFactor, aUnits );
50 if( myObjects.IsBound( anObj ) ) {
51 Handle(AIS_GlobalStatus) STATUS = myObjects(anObj);
52 if ( STATUS->GraphicStatus() == AIS_DS_Displayed )
59 //=======================================================================
60 //function : HasPolygonOffsets
62 //=======================================================================
63 Standard_Boolean AIS_InteractiveContext::HasPolygonOffsets(const Handle(AIS_InteractiveObject)& anObj) const
65 return ( !anObj.IsNull() && anObj->HasPolygonOffsets() );
68 //=======================================================================
69 //function : PolygonOffsets
71 //=======================================================================
72 void AIS_InteractiveContext::PolygonOffsets(
73 const Handle(AIS_InteractiveObject)& anObj,
74 Standard_Integer& aMode,
75 Standard_ShortReal& aFactor,
76 Standard_ShortReal& aUnits) const
78 if ( HasPolygonOffsets( anObj ) )
79 anObj->PolygonOffsets( aMode, aFactor, aUnits );
81 // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets