1 // OCC_BaseView.cpp: implementation of the OCC_BaseView class.
3 //////////////////////////////////////////////////////////////////////
6 #include "OCC_BaseView.h"
8 //=======================================================================
9 //function : Constructor
11 //=======================================================================
12 OCC_BaseView::OCC_BaseView()
18 myRect (new AIS_RubberBand (Quantity_Color(Quantity_NOC_WHITE), Aspect_TOL_SOLID, 1.0) )
20 myRect->SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_2d, Aspect_TOTP_LEFT_LOWER));
21 if (myRect->ZLayer() != Graphic3d_ZLayerId_TopOSD)
23 myRect->SetZLayer (Graphic3d_ZLayerId_TopOSD);
28 //=======================================================================
29 //function : Destructor
31 //=======================================================================
32 OCC_BaseView::~OCC_BaseView()
37 //=======================================================================
38 //function : GetDocument
40 //=======================================================================
41 OCC_BaseDoc* OCC_BaseView::GetDocument() // non-debug version is inline
43 return (OCC_BaseDoc*)m_pDocument;
46 //=======================================================================
47 //function : drawRectangle
49 //=======================================================================
50 void OCC_BaseView::drawRectangle (const Standard_Integer theMinX,
51 const Standard_Integer theMinY,
52 const Standard_Integer theMaxX,
53 const Standard_Integer theMaxY,
54 const Handle(AIS_InteractiveContext)& theContext,
55 const Standard_Boolean toDraw)
61 myRect->SetRectangle (theMinX, aRect.Height() - theMinY, theMaxX, aRect.Height() - theMaxY);
63 if (!theContext->IsDisplayed (myRect))
65 theContext->Display (myRect, Standard_False);
69 theContext->Redisplay (myRect, Standard_False);
74 theContext->Remove (myRect, Standard_False);
77 theContext->CurrentViewer()->RedrawImmediate();