mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0023663: Removing 2D viewer library
Deleted TKV2d toolkit and CGM, MFT,FontMFT, PlotMgt, PS packages. Deleted 2d test cases. Deleted WNT_WDriver and Xw_Driver, edited Aspect_Driver. Deleted trailing spaces, removed WNT_FontMapEntry, WNT_FontTable, WNT_HFontTable Deleting tests for 2D viewer
This commit is contained in:
@@ -55,12 +55,9 @@ uses
|
||||
TColStd,
|
||||
gp,
|
||||
Select3D,
|
||||
Select2D,
|
||||
Graphic2d,
|
||||
Graphic3d,Visual3d,
|
||||
Quantity,
|
||||
Prs3d,
|
||||
V2d,
|
||||
V3d,
|
||||
PrsMgr,
|
||||
SelectBasics,
|
||||
@@ -101,12 +98,6 @@ is
|
||||
---Purpose: Viewer Selector for a view from V3d
|
||||
-- Accepts Only Sensitive Entities inheriting Select3D entities...
|
||||
|
||||
class ViewerSelector2d;
|
||||
---Purpose: Viewer Selector for a view from V2d
|
||||
-- Accepts Only Sensitive Entities inheriting Select2D entities...
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class BRepSelectionTool;
|
||||
@@ -132,9 +123,6 @@ is
|
||||
|
||||
|
||||
|
||||
class SensitiveText2d;
|
||||
class TextProjector2d;
|
||||
|
||||
|
||||
|
||||
---Category: Shape Filters
|
||||
|
@@ -1,95 +0,0 @@
|
||||
-- Created by: Robert COUBLANC
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
--
|
||||
-- The content of this file is subject to the Open CASCADE Technology Public
|
||||
-- License Version 6.5 (the "License"). You may not use the content of this file
|
||||
-- except in compliance with the License. Please obtain a copy of the License
|
||||
-- at http://www.opencascade.org and read it completely before using this file.
|
||||
--
|
||||
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
--
|
||||
-- The Original Code and all software distributed under the License is
|
||||
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
-- Initial Developer 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 the rights and limitations under the License.
|
||||
|
||||
|
||||
|
||||
|
||||
class SensitiveText2d from StdSelect inherits SensitiveEntity from
|
||||
Select2D
|
||||
|
||||
---Purpose: A framework to define a sensitive text entity for 2D views.
|
||||
|
||||
uses
|
||||
ExtendedString from TCollection,
|
||||
EntityOwner from SelectBasics,
|
||||
ListOfBox2d from SelectBasics,
|
||||
Projector from Select2D,
|
||||
Array1OfPnt2d from TColgp,
|
||||
Box2d from Bnd
|
||||
|
||||
is
|
||||
|
||||
Create(anOwnerId : EntityOwner from SelectBasics;
|
||||
aString : ExtendedString from TCollection;
|
||||
XPox,YPos : Real from Standard;
|
||||
Angle : Real = 0;
|
||||
aFontIndex: Integer = -1)
|
||||
returns mutable SensitiveText2d from StdSelect;
|
||||
---Purpose: Constructs a sensitive 2D text object defined by the
|
||||
-- owner anOwnerId, the string aString, the point
|
||||
-- defined by the parameters XPos and YPos, the angle
|
||||
-- Angle and the font index aFontIndex.
|
||||
|
||||
NeedsConversion (me) returns Boolean is redefined static;
|
||||
---Purpose: returns Standard_True
|
||||
---Level: Public
|
||||
---C++: inline
|
||||
|
||||
Convert(me:mutable; aTextProj : Projector from Select2D) is redefined virtual;
|
||||
---Purpose: gets the size of the text in the 2d view
|
||||
---Level: Public
|
||||
|
||||
|
||||
Areas(me:mutable; aresult : in out ListOfBox2d from SelectBasics) is redefined static;
|
||||
---Level: Public
|
||||
---Purpose: to be implemented specifically by each type of
|
||||
-- sensitive primitive .
|
||||
--
|
||||
|
||||
Matches (me :mutable;
|
||||
X,Y : Real from Standard;
|
||||
aTol: Real from Standard;
|
||||
DMin: out Real from Standard)
|
||||
returns Boolean
|
||||
is redefined static;
|
||||
|
||||
Matches (me :mutable;
|
||||
XMin,YMin,XMax,YMax : Real from Standard;
|
||||
aTol: Real from Standard)
|
||||
returns Boolean
|
||||
is redefined static;
|
||||
|
||||
Matches (me :mutable;
|
||||
Polyline:Array1OfPnt2d from TColgp;
|
||||
aBox:Box2d from Bnd;
|
||||
aTol: Real from Standard)
|
||||
returns Boolean
|
||||
is redefined static;
|
||||
|
||||
fields
|
||||
|
||||
mytext : ExtendedString from TCollection;
|
||||
myxpos : Real;
|
||||
myypos : Real;
|
||||
myangle: Real;
|
||||
myfont : Integer;
|
||||
|
||||
myinitbox: Box2d from Bnd; --box before rotation...
|
||||
|
||||
end SensitiveText2d;
|
@@ -1,91 +0,0 @@
|
||||
// Created on: 1995-04-21
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer 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 the rights and limitations under the License.
|
||||
|
||||
|
||||
|
||||
#include <StdSelect_SensitiveText2d.ixx>
|
||||
#include <StdSelect_TextProjector2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
|
||||
|
||||
StdSelect_SensitiveText2d::
|
||||
StdSelect_SensitiveText2d (const Handle(SelectBasics_EntityOwner)& anOwnerId,
|
||||
const TCollection_ExtendedString& aString,
|
||||
const Standard_Real XPos,
|
||||
const Standard_Real YPos,
|
||||
const Standard_Real Angle,
|
||||
const Standard_Integer aFontIndex):
|
||||
Select2D_SensitiveEntity(anOwnerId),
|
||||
mytext(aString),
|
||||
myxpos(XPos),
|
||||
myypos(YPos),
|
||||
myangle(Angle),
|
||||
myfont(aFontIndex) {}
|
||||
|
||||
|
||||
|
||||
void StdSelect_SensitiveText2d::Convert(const Handle(Select2D_Projector)& aPrj)
|
||||
{
|
||||
if(!(Handle(StdSelect_TextProjector2d)::DownCast(aPrj)).IsNull())
|
||||
{
|
||||
gp_Pnt2d FirstP,LastP;
|
||||
Handle(StdSelect_TextProjector2d)::DownCast(aPrj)
|
||||
->Convert(mytext,myxpos,myypos,FirstP,LastP,myfont);
|
||||
myinitbox.Set(FirstP);
|
||||
myinitbox.Add(LastP);
|
||||
}
|
||||
}
|
||||
|
||||
void StdSelect_SensitiveText2d::Areas(SelectBasics_ListOfBox2d& aresult)
|
||||
{
|
||||
if(myangle==0.) aresult.Append(myinitbox);
|
||||
else {
|
||||
gp_Trsf2d T; T.SetRotation(gp_Pnt2d(myxpos,myypos),myangle);
|
||||
aresult.Append(myinitbox.Transformed(T));
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Boolean StdSelect_SensitiveText2d::Matches(const Standard_Real X,
|
||||
const Standard_Real Y,
|
||||
const Standard_Real aTol,
|
||||
Standard_Real& DMin)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
Standard_Boolean StdSelect_SensitiveText2d::Matches
|
||||
(const Standard_Real XMin,
|
||||
const Standard_Real YMin,
|
||||
const Standard_Real XMax,
|
||||
const Standard_Real YMax,
|
||||
const Standard_Real aTol) {
|
||||
|
||||
return Standard_True;
|
||||
|
||||
}
|
||||
|
||||
Standard_Boolean StdSelect_SensitiveText2d::Matches
|
||||
(const TColgp_Array1OfPnt2d& aPoly,
|
||||
const Bnd_Box2d& aBox,
|
||||
const Standard_Real aTol) {
|
||||
|
||||
return Standard_True;
|
||||
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
// Created on: 1995-04-21
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer 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 the rights and limitations under the License.
|
||||
|
||||
|
||||
|
||||
inline Standard_Boolean StdSelect_SensitiveText2d::NeedsConversion() const
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
@@ -27,8 +27,6 @@ private class Shape from StdSelect inherits PresentableObject from PrsMgr
|
||||
uses
|
||||
Projector from Prs3d,
|
||||
Transformation from Geom,
|
||||
PresentationManager2d from PrsMgr,
|
||||
GraphicObject from Graphic2d,
|
||||
Shape from TopoDS,
|
||||
PresentationManager3d from PrsMgr,
|
||||
Presentation from Prs3d
|
||||
@@ -47,11 +45,6 @@ is
|
||||
aPresentation: mutable Presentation from Prs3d)
|
||||
is redefined static private;
|
||||
|
||||
Compute(me:mutable;
|
||||
aPresentationManager: PresentationManager2d from PrsMgr;
|
||||
aPresentation: mutable GraphicObject from Graphic2d;
|
||||
aMode: Integer from Standard = 0)
|
||||
is redefined static private;
|
||||
|
||||
Compute(me : mutable;
|
||||
aProjector : Projector from Prs3d;
|
||||
|
@@ -72,12 +72,6 @@ void StdSelect_Shape::Compute(const Handle_Prs3d_Projector& aProjector ,
|
||||
PrsMgr_PresentableObject::Compute(aProjector,aGeomTrans,aPresentation);
|
||||
}
|
||||
|
||||
void StdSelect_Shape::Compute(const Handle_PrsMgr_PresentationManager2d& aPrsMgr,
|
||||
const Handle_Graphic2d_GraphicObject& aGO,
|
||||
const int anInt)
|
||||
{
|
||||
PrsMgr_PresentableObject::Compute(aPrsMgr,aGO,anInt);
|
||||
}
|
||||
|
||||
void StdSelect_Shape::Compute(const Handle_Prs3d_Projector& aProjector,
|
||||
const Handle_Prs3d_Presentation& aPresentation)
|
||||
|
@@ -1,73 +0,0 @@
|
||||
-- Created on: 1995-04-21
|
||||
-- Created by: Robert COUBLANC
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
--
|
||||
-- The content of this file is subject to the Open CASCADE Technology Public
|
||||
-- License Version 6.5 (the "License"). You may not use the content of this file
|
||||
-- except in compliance with the License. Please obtain a copy of the License
|
||||
-- at http://www.opencascade.org and read it completely before using this file.
|
||||
--
|
||||
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
--
|
||||
-- The Original Code and all software distributed under the License is
|
||||
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
-- Initial Developer 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 the rights and limitations under the License.
|
||||
|
||||
|
||||
|
||||
|
||||
class TextProjector2d from StdSelect inherits Projector from Select2D
|
||||
|
||||
---Purpose: A projector framework specific to texts in 2D views.
|
||||
-- For a string of text, an insertion point and a font, it
|
||||
-- calculates the minimum and maximum points of the text box in the view.
|
||||
|
||||
uses
|
||||
View from V2d,
|
||||
Trsf2d from gp,
|
||||
Pnt2d from gp,
|
||||
ExtendedString from TCollection
|
||||
|
||||
is
|
||||
|
||||
Create(aView: View from V2d) returns mutable TextProjector2d;
|
||||
---Purpose: Constructs a 2D text projector framework defined by the 2D view aView.
|
||||
|
||||
Set(me:mutable; aView:View from V2d) is static;
|
||||
---Purpose: Sets the view aView.
|
||||
---C++: inline
|
||||
|
||||
|
||||
Set(me:mutable;atrsf:Trsf2d from gp)is static;
|
||||
---Purpose: Sets the transformation atrsf.
|
||||
-- This transformation is applied to the attachment point
|
||||
-- of the text, and takes the size and length of the text
|
||||
-- into account to give the upper right hand point of the text box.
|
||||
---C++: inline
|
||||
|
||||
|
||||
Convert(me;aPointIn : Pnt2d from gp;
|
||||
aPointOut : out Pnt2d from gp) is redefined virtual;
|
||||
---Level: Public
|
||||
---Purpose: applies the stored trsf to aPointIn to get aPointOut
|
||||
|
||||
|
||||
Convert(me;aText: ExtendedString from TCollection;
|
||||
XPos,YPos: Real;
|
||||
MinPoint,MaxPoint: out Pnt2d from gp;
|
||||
afont : Integer=-1) is virtual;
|
||||
---Level: Public
|
||||
---Purpose:XPos,YPos is the AttachPoint for the text.First, the stored Trsf is
|
||||
-- applied to this point, then we get the size and length of text to
|
||||
-- give the upper point
|
||||
|
||||
fields
|
||||
|
||||
myview : View from V2d; --to be replaced by a pointer...
|
||||
|
||||
end TextProjector2d;
|
@@ -1,73 +0,0 @@
|
||||
// Created on: 1995-04-21
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer 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 the rights and limitations under the License.
|
||||
|
||||
|
||||
|
||||
#include <StdSelect_TextProjector2d.ixx>
|
||||
#include <Aspect_WindowDriver.hxx>
|
||||
|
||||
|
||||
//==================================================
|
||||
// Function:
|
||||
// Purpose :
|
||||
//==================================================
|
||||
|
||||
StdSelect_TextProjector2d::
|
||||
StdSelect_TextProjector2d(const Handle(V2d_View)& aView):
|
||||
myview(aView)
|
||||
{
|
||||
}
|
||||
|
||||
//==================================================
|
||||
// Function:
|
||||
// Purpose :
|
||||
//==================================================
|
||||
|
||||
void StdSelect_TextProjector2d::
|
||||
Convert(const gp_Pnt2d& aPointIn, gp_Pnt2d& aPointOut) const
|
||||
{
|
||||
aPointOut = aPointIn.Transformed(mytrsf);
|
||||
}
|
||||
|
||||
//==================================================
|
||||
// Function:
|
||||
// Purpose :
|
||||
//==================================================
|
||||
|
||||
void StdSelect_TextProjector2d
|
||||
::Convert(const TCollection_ExtendedString& aText,
|
||||
const Standard_Real XPos,
|
||||
const Standard_Real YPos,
|
||||
gp_Pnt2d& MinPoint,
|
||||
gp_Pnt2d& MaxPoint,
|
||||
const Standard_Integer afont) const
|
||||
{
|
||||
Standard_ShortReal myL,myH;
|
||||
MinPoint = gp_Pnt2d(XPos,YPos).Transformed(mytrsf);
|
||||
myview->Driver()->TextSize(aText,myL,myH,afont);
|
||||
Standard_Real myWinL=myview->Convert(myL);
|
||||
Standard_Real myWinH=myview->Convert(myH);
|
||||
|
||||
MaxPoint.SetCoord(XPos+myWinL,YPos+myWinH);
|
||||
MaxPoint.Transform(mytrsf);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,31 +0,0 @@
|
||||
// Created on: 1995-05-02
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer 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 the rights and limitations under the License.
|
||||
|
||||
|
||||
inline void StdSelect_TextProjector2d::Set(const Handle(V2d_View)& aView)
|
||||
{
|
||||
myview = aView;
|
||||
}
|
||||
|
||||
inline void StdSelect_TextProjector2d::Set(const gp_Trsf2d& atrsf)
|
||||
{
|
||||
mytrsf = atrsf;
|
||||
}
|
||||
|
@@ -1,93 +0,0 @@
|
||||
-- Created on: 1995-02-23
|
||||
-- Created by: Mister rmi
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
--
|
||||
-- The content of this file is subject to the Open CASCADE Technology Public
|
||||
-- License Version 6.5 (the "License"). You may not use the content of this file
|
||||
-- except in compliance with the License. Please obtain a copy of the License
|
||||
-- at http://www.opencascade.org and read it completely before using this file.
|
||||
--
|
||||
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
--
|
||||
-- The Original Code and all software distributed under the License is
|
||||
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
-- Initial Developer 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 the rights and limitations under the License.
|
||||
|
||||
|
||||
|
||||
class ViewerSelector2d from StdSelect inherits ViewerSelector from SelectMgr
|
||||
|
||||
---Purpose: A viewer selection framework.
|
||||
-- The objects defined in this framework can be passed to a selection manager.
|
||||
|
||||
uses
|
||||
|
||||
View from V2d,
|
||||
Projector from Select2D,
|
||||
Selection from SelectMgr,
|
||||
GraphicObject from Graphic2d
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable ViewerSelector2d from StdSelect;
|
||||
|
||||
--- Purpose: Constructs an empty viewer selection framework.
|
||||
|
||||
Create (aProjector: Projector from Select2D)
|
||||
returns mutable ViewerSelector2d from StdSelect;
|
||||
---Purpose: Constructs the viewer selection framework defined by
|
||||
-- the projector aProjector.
|
||||
|
||||
Set(me:mutable; aSensitivity : Integer) is static;
|
||||
---Level: Public
|
||||
---Purpose: Sets a pixel tolerance for the selection.
|
||||
-- will be converted for picking in a view.
|
||||
|
||||
|
||||
Set(me:mutable; aProjector: Projector from Select2D) is static;
|
||||
---Purpose: Sets the new projector aProjector.
|
||||
|
||||
Convert(me:mutable;aSelection:mutable Selection from SelectMgr)
|
||||
is redefined static;
|
||||
|
||||
Pick (me : mutable;XPix,YPix:Integer;
|
||||
aView : View from V2d) is static;
|
||||
---Purpose: Returns the pixel coordinates of the mouse Xpix, Ypix
|
||||
-- in the view aView.
|
||||
|
||||
Pick (me:mutable;XPMin,YPMin,XPMax,YPMax:Integer;aView:View from V2d) is static;
|
||||
---Purpose: Returns the minimum and maximum pixel coordinates
|
||||
-- XPMin, YPMin and XPMax, YPMax defining a 2D area in the view aView.
|
||||
|
||||
|
||||
|
||||
Projector (me) returns any Projector from Select2D;
|
||||
---Purpose: Returns the projector which defines this framework.
|
||||
---C++: inline
|
||||
|
||||
|
||||
DisplayAreas (me:mutable;aView:View from V2d) is static;
|
||||
---Purpose: Displays the active areas in the given view;
|
||||
|
||||
|
||||
|
||||
ClearAreas(me:mutable) is static;
|
||||
---Purpose: Clear the displayed sensitive areas from this framework..
|
||||
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myprj : Projector from Select2D;
|
||||
mypixtol : Integer;
|
||||
|
||||
mygo : GraphicObject from Graphic2d;
|
||||
|
||||
end ViewerSelector2d;
|
||||
|
||||
|
@@ -1,173 +0,0 @@
|
||||
// Created on: 1995-02-23
|
||||
// Created by: Mister rmi
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer 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 the rights and limitations under the License.
|
||||
|
||||
|
||||
|
||||
|
||||
#include <StdSelect_ViewerSelector2d.ixx>
|
||||
#include <Graphic2d_Array1OfVertex.hxx>
|
||||
#include <Graphic2d_GraphicObject.hxx>
|
||||
#include <SelectMgr_DataMapIteratorOfDataMapOfIntegerSensitive.hxx>
|
||||
#include <Select2D_SensitiveEntity.hxx>
|
||||
#include <StdSelect_TextProjector2d.hxx>
|
||||
#include <SelectBasics_ListOfBox2d.hxx>
|
||||
#include <Bnd_Box2d.hxx>
|
||||
#include <Graphic2d_Vertex.hxx>
|
||||
#include <Graphic2d_Polyline.hxx>
|
||||
#include <Graphic2d_Array1OfVertex.hxx>
|
||||
#include <SelectBasics_ListIteratorOfListOfBox2d.hxx>
|
||||
|
||||
//==================================================
|
||||
// Function:
|
||||
// Purpose :
|
||||
//==================================================
|
||||
|
||||
StdSelect_ViewerSelector2d::StdSelect_ViewerSelector2d():
|
||||
mypixtol(2)
|
||||
{}
|
||||
|
||||
StdSelect_ViewerSelector2d::StdSelect_ViewerSelector2d(const Handle(Select2D_Projector)& aPrj):
|
||||
myprj(aPrj),
|
||||
mypixtol(2)
|
||||
{}
|
||||
|
||||
//==================================================
|
||||
// Function: Set
|
||||
// Purpose :
|
||||
//==================================================
|
||||
|
||||
void StdSelect_ViewerSelector2d::Set(const Standard_Integer apixtol)
|
||||
{mypixtol = apixtol;
|
||||
tosort = Standard_True;
|
||||
}
|
||||
|
||||
//==================================================
|
||||
// Function: Set
|
||||
// Purpose :
|
||||
//==================================================
|
||||
|
||||
void StdSelect_ViewerSelector2d::Set(const Handle(Select2D_Projector)& aPrj)
|
||||
{myprj = aPrj;
|
||||
UpdateConversion();
|
||||
}
|
||||
|
||||
//==================================================
|
||||
// Function: Convert
|
||||
// Purpose :
|
||||
//==================================================
|
||||
|
||||
void StdSelect_ViewerSelector2d::Convert(const Handle(SelectMgr_Selection)& aSel)
|
||||
{
|
||||
for(aSel->Init();aSel->More();aSel->Next())
|
||||
{
|
||||
if(aSel->Sensitive()->NeedsConversion())
|
||||
Handle(Select2D_SensitiveEntity)::
|
||||
DownCast(aSel->Sensitive())->Convert(myprj);
|
||||
}
|
||||
tosort = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
void StdSelect_ViewerSelector2d::Pick(const Standard_Integer XPix,
|
||||
const Standard_Integer YPix,
|
||||
const Handle(V2d_View)& aViou)
|
||||
{
|
||||
Standard_Real Xr,Yr;
|
||||
aViou->Convert(XPix,YPix,Xr,Yr);
|
||||
InitSelect(Xr,Yr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void StdSelect_ViewerSelector2d::Pick(const Standard_Integer XPMin,
|
||||
const Standard_Integer YPMin,
|
||||
const Standard_Integer XPMax,
|
||||
const Standard_Integer YPMax,
|
||||
const Handle(V2d_View)& aViou)
|
||||
{
|
||||
if(mypixtol!=0) mytolerance = aViou->Convert(mypixtol);
|
||||
Standard_Real X1,Y1,X2,Y2;
|
||||
aViou->Convert(XPMin,YPMin,X1,Y1);
|
||||
aViou->Convert(XPMax,YPMax,X2,Y2);
|
||||
InitSelect(Min(X1,X2),
|
||||
Min(Y1,Y2),
|
||||
Max(X1,X2),
|
||||
Max(Y1,Y2));
|
||||
}
|
||||
|
||||
//==================================================
|
||||
// Function: DisplayAreas
|
||||
// Purpose :
|
||||
//==================================================
|
||||
void StdSelect_ViewerSelector2d::
|
||||
DisplayAreas(const Handle(V2d_View)& aViou)
|
||||
{
|
||||
mygo = new Graphic2d_GraphicObject(aViou->View());
|
||||
|
||||
Graphic2d_Array1OfVertex Av1 (1,5);
|
||||
SelectMgr_DataMapIteratorOfDataMapOfIntegerSensitive It(myentities);
|
||||
SelectBasics_ListOfBox2d BoxList;
|
||||
Standard_Real xmin,ymin,xmax,ymax;
|
||||
Handle(Graphic2d_Polyline) pol;
|
||||
|
||||
for(;It.More();It.Next())
|
||||
{
|
||||
It.Value()->Areas(BoxList);
|
||||
// DEN
|
||||
SelectBasics_ListIteratorOfListOfBox2d anIterator(BoxList);
|
||||
for (;anIterator.More();anIterator.Next())
|
||||
{
|
||||
anIterator.Value().Get(xmin,ymin,xmax,ymax);
|
||||
|
||||
// FIN DEN
|
||||
// BY DEN BoxList.Last().Get(xmin,ymin,xmax,ymax);
|
||||
// construction des vertex graphiques
|
||||
Av1.SetValue(1,Graphic2d_Vertex(xmin-mytolerance,ymin-mytolerance));
|
||||
Av1.SetValue(2,Graphic2d_Vertex(xmax+mytolerance,ymin-mytolerance));
|
||||
Av1.SetValue(3,Graphic2d_Vertex(xmax+mytolerance,ymax+mytolerance));
|
||||
Av1.SetValue(4,Graphic2d_Vertex(xmin-mytolerance,ymax+mytolerance));
|
||||
Av1.SetValue(5,Graphic2d_Vertex(xmin-mytolerance,ymin-mytolerance));
|
||||
|
||||
pol = new Graphic2d_Polyline(mygo,Av1);
|
||||
pol ->SetColorIndex(4); //vert
|
||||
pol->SetTypeIndex(2);
|
||||
// DEN
|
||||
}
|
||||
// FIN DEN
|
||||
}
|
||||
mygo->Display();
|
||||
aViou->Update();
|
||||
|
||||
}
|
||||
|
||||
//================================================
|
||||
// function : ClearAreas
|
||||
// purpose :
|
||||
//================================================
|
||||
|
||||
void StdSelect_ViewerSelector2d::ClearAreas ()
|
||||
{
|
||||
if (mygo.IsNull()) return;
|
||||
mygo->RemovePrimitives();
|
||||
mygo->Display();
|
||||
mygo->Remove();
|
||||
}
|
||||
|
||||
|
@@ -1,21 +0,0 @@
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer 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 the rights and limitations under the License.
|
||||
|
||||
inline Handle(Select2D_Projector) StdSelect_ViewerSelector2d
|
||||
::Projector () const
|
||||
{return myprj;}
|
Reference in New Issue
Block a user