Introduce Point Sprites usage.
Graphic3d_Group - drop Marker(),MarkerSet() methods - markers should be drawn using AddPrimitiveArray.
Added new Draw Harness commands vcaps, vmarkerstest.
for (int i=1;i<=2;i++)
{
Handle (Sample2D_Markers) aMarker =
- new Sample2D_Markers(10+20,5*i,Aspect_TOM_BALL,(Quantity_NameOfColor)(aColor++));
+ new Sample2D_Markers(10+20,5*i,Aspect_TOM_RING1,(Quantity_NameOfColor)(aColor++));
myAISContext->Display(aMarker, Standard_False);
}
for (int i=1;i<=2;i++)
void OCC_2dView::OnBUTTONGridRectLines()
{
Handle(V3d_Viewer) aViewer = myV2dView->Viewer();
- Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_BALL,Quantity_NOC_WHITE,2);
+ Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2);
aViewer->SetGridEcho(aGridAspect);
Standard_Integer aWidth=0, aHeight=0, anOffset=0;
myV2dView->Window()->Size(aWidth,aHeight);
void OCC_2dView::OnBUTTONGridRectPoints()
{
Handle(V3d_Viewer) aViewer = myV2dView->Viewer();
- Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_BALL,Quantity_NOC_WHITE,2);
+ Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2);
aViewer->SetGridEcho(aGridAspect);
Standard_Integer aWidth=0, aHeight=0, anOffset=0;
myV2dView->Window()->Size(aWidth,aHeight);
void OCC_2dView::OnBUTTONGridCircLines()
{
Handle(V3d_Viewer) aViewer = myV2dView->Viewer();
- Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_BALL,Quantity_NOC_WHITE,2);
+ Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2);
aViewer->SetGridEcho(aGridAspect);
Standard_Integer aWidth=0, aHeight=0, anOffset=0;
myV2dView->Window()->Size(aWidth,aHeight);
void OCC_2dView::OnBUTTONGridCircPoints()
{
Handle(V3d_Viewer) aViewer = myV2dView->Viewer();
- Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_BALL,Quantity_NOC_WHITE,2);
+ Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2);
aViewer->SetGridEcho(aGridAspect);
Standard_Integer aWidth=0, aHeight=0, anOffset=0;
myV2dView->Window()->Size(aWidth,aHeight);
const Aspect_TypeOfMarker theMarkerType,
const Quantity_Color theColor,
const Standard_Real theScaleOrId)
- :AIS_InteractiveObject(),myListVertex(1,1)
+ :AIS_InteractiveObject(),myArrayOfPoints (new Graphic3d_ArrayOfPoints (1))
{
myXPosition = theXPosition;
myYPosition = theYPosition;
Sample2D_Markers::Sample2D_Markers (const Quantity_Length theXPosition ,
const Quantity_Length theYPosition ,
- const Graphic3d_Array1OfVertex& theListVertex,
+ const Handle(Graphic3d_ArrayOfPoints)& theArrayOfPoints,
const Aspect_TypeOfMarker theMarkerType,
const Quantity_Color theColor,
const Standard_Real theScaleOrId)
- :AIS_InteractiveObject(),myListVertex(1,6)
+ :AIS_InteractiveObject(),myArrayOfPoints (new Graphic3d_ArrayOfPoints (6))
{
myXPosition = theXPosition;
myYPosition = theYPosition;
myMarkerType = theMarkerType;
myColor = theColor;
myIndex = theScaleOrId;
- myListVertex = theListVertex;
+ myArrayOfPoints = theArrayOfPoints;
}
{
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(Aspect_TOM_POINT,myColor,myIndex);
Prs3d_Root::CurrentGroup(aPresentation)->SetGroupPrimitivesAspect(aMarker);
- Prs3d_Root::CurrentGroup(aPresentation)->MarkerSet(myListVertex);
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (myArrayOfPoints);
}
else
{
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(myMarkerType,myColor,myIndex);
aPresentation->SetPrimitivesAspect(aMarker);
- Graphic3d_Vertex aV3d(myXPosition, myYPosition, 0.);
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(aV3d);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (myXPosition, myYPosition, 0);
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
}
}
#include <Standard_Macro.hxx>
#include <Standard_DefineHandle.hxx>
#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
DEFINE_STANDARD_HANDLE(Sample2D_Markers,AIS_InteractiveObject)
class Sample2D_Markers : public AIS_InteractiveObject {
// Polyline marker
Standard_EXPORT Sample2D_Markers (const Quantity_Length theXPosition ,
const Quantity_Length theYPosition ,
- const Graphic3d_Array1OfVertex& theListVertex,
+ const Handle(Graphic3d_ArrayOfPoints)& theArrayOfPoints,
const Aspect_TypeOfMarker theMarkerType,
const Quantity_Color theColor,
const Standard_Real theScaleOrId=2.0);
Quantity_Length myHeight ;
Standard_Real myIndex ;//myScaleOrId
// specific polyline marker
-Graphic3d_Array1OfVertex myListVertex ;
+Handle(Graphic3d_ArrayOfPoints) myArrayOfPoints;
};
#include <Graphic3d_Structure.hxx>
#include <Graphic3d_Group.hxx>
#include <Quantity_Color.hxx>
-#include <Graphic3d_Vertex.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectBasics_EntityOwner.hxx>
PtA->SetScale(3.);
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
TheGroup->SetPrimitivesAspect(PtA);
- Graphic3d_Vertex Vtx(myComponent->X(),myComponent->Y(),myComponent->Z());
- TheGroup->Marker(Vtx);
+ Handle(Graphic3d_ArrayOfPoints) aPoint = new Graphic3d_ArrayOfPoints (1);
+ aPoint->AddVertex (myComponent->X(),myComponent->Y(),myComponent->Z());
+ TheGroup->AddPrimitiveArray (aPoint);
}
}
enumeration TypeOfMarker is TOM_POINT,
TOM_PLUS,
TOM_STAR,
- TOM_O,
TOM_X,
+ TOM_O,
TOM_O_POINT,
TOM_O_PLUS,
TOM_O_STAR,
TOM_O_X,
- TOM_BALL,
TOM_RING1,
TOM_RING2,
TOM_RING3,
+ TOM_BALL,
TOM_USERDEFINED
end TypeOfMarker;
---Purpose: Definition of types of markers
-- TOM_POINT point .
-- TOM_PLUS plus +
-- TOM_STAR star *
- -- TOM_O circle O
-- TOM_X cross x
+ -- TOM_O circle O
-- TOM_O_POINT a point in a circle
-- TOM_O_PLUS a plus in a circle
-- TOM_O_STAR a star in a circle
-- TOM_O_X a cross in a circle
- -- TOM_BALL a ball with 1 color and different saturations
-- TOM_RING1 a large ring
-- TOM_RING2 a medium ring
-- TOM_RING3 a small ring
+ -- TOM_BALL a ball with 1 color and different saturations
-- TOM_USERDEFINED defined by Users
--
---Category: Enumerations
MySpoint->SetValue(i+4,TRUE);
}
break ;
- case Aspect_TOM_BALL :
- MyXpoint = new TShort_HArray1OfShortReal(1,
- MAX_BALL_LINE*(MAX_O_POINT+1)) ;
- MyYpoint = new TShort_HArray1OfShortReal(1,
- MAX_BALL_LINE*(MAX_O_POINT+1)) ;
- MySpoint = new TColStd_HArray1OfBoolean(1,
- MAX_BALL_LINE*(MAX_O_POINT+1)) ;
-
- { Standard_Integer i,j,n = 0;
- Standard_Real da = 2. * M_PI / MAX_O_POINT;
- Standard_Real dr = 1./MAX_BALL_LINE;
- Standard_Real a,r = 1.;
-
- for( i=1 ; i<= MAX_BALL_LINE ; i++ ) {
- a = 0.;
- for( j=1 ; j<= MAX_O_POINT+1 ; j++,a += da ) {
- n++;
- MyXpoint->SetValue(n,(float )( r*Cos(a)));
- MyYpoint->SetValue(n,(float )( r*Sin(a)));
- MySpoint->SetValue(n,(j > 1) ? TRUE : FALSE);
- }
- MyXpoint->SetValue(n,(float ) r);
- MyYpoint->SetValue(n,0.);
- r -= dr;
- }
- }
- break ;
case Aspect_TOM_RING1 :
MyXpoint = new TShort_HArray1OfShortReal(1,
(MAX_BALL_LINE/4)*(MAX_O_POINT+1)) ;
#include <Graphic3d_Vertex.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <Aspect_AspectMarker.hxx>
const DsgPrs_ArrowSide ArrowSide)
{
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-
- Handle(Graphic3d_AspectMarker3d) MarkerAsp = new Graphic3d_AspectMarker3d();
- MarkerAsp->SetType(Aspect_TOM_BALL);
- MarkerAsp->SetScale(0.8);
- Quantity_Color acolor;
- Aspect_TypeOfLine atype;
- Standard_Real awidth;
- LA->LineAspect()->Aspect()->Values(acolor, atype, awidth);
- MarkerAsp->SetColor(acolor);
- Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
-
- // symbols aux extremites de la cote
-// Graphic3d_Vertex V3d,V3d1,V3d2;
- Graphic3d_Vertex V3d,V3d1;
+
+ Quantity_Color aColor;
+ Aspect_TypeOfLine aType;
+ Standard_Real aWidth;
+ LA->LineAspect()->Aspect()->Values (aColor, aType, aWidth);
+ Handle(Graphic3d_AspectMarker3d) aMarkerAsp = new Graphic3d_AspectMarker3d (Aspect_TOM_O, aColor, 1.0);
+ Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAsp);
switch(ArrowSide) {
case DsgPrs_AS_NONE:
case DsgPrs_AS_FIRSTPT:
{
- V3d = Graphic3d_Vertex (pt1.X(), pt1.Y(), pt1.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
-
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (pt1.X(), pt1.Y(), pt1.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
break;
}
case DsgPrs_AS_LASTPT:
{
// On dessine un rond
- V3d = Graphic3d_Vertex (pt2.X(), pt2.Y(), pt2.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
-
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (pt2.X(), pt2.Y(), pt2.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
break;
}
case DsgPrs_AS_BOTHPT:
{
- V3d1 = Graphic3d_Vertex (pt1.X(), pt1.Y(), pt1.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d1);
- Graphic3d_Vertex V3d2(pt2.X(), pt2.Y(), pt2.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d2);
-
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints1 = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints1->AddVertex (pt1.X(), pt1.Y(), pt1.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints1);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints2 = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints2->AddVertex (pt2.X(), pt2.Y(), pt2.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints2);
break;
}
{
// an Arrow
Prs3d_Arrow::Draw(aPresentation,
- pt1,
- dir1,
- LA->ArrowAspect()->Angle(),
- LA->ArrowAspect()->Length());
+ pt1,
+ dir1,
+ LA->ArrowAspect()->Angle(),
+ LA->ArrowAspect()->Length());
// a Round
- V3d = Graphic3d_Vertex (pt2.X(), pt2.Y(), pt2.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
-
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (pt2.X(), pt2.Y(), pt2.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
break;
}
case DsgPrs_AS_FIRSTPT_LASTAR:
{
// a Round
- V3d = Graphic3d_Vertex (pt1.X(), pt1.Y(), pt1.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (pt1.X(), pt1.Y(), pt1.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
// an Arrow
Prs3d_Arrow::Draw(aPresentation,
- pt2,
- dir2,
- LA->ArrowAspect()->Angle(),
- LA->ArrowAspect()->Length());
-
+ pt2,
+ dir2,
+ LA->ArrowAspect()->Angle(),
+ LA->ArrowAspect()->Length());
break;
}
}
const DsgPrs_ArrowSide ArrowSide,
const Standard_Boolean drawFromCenter)
{
- Quantity_Color acolor;
- Aspect_TypeOfLine atype;
- Standard_Real awidth;
+ Quantity_Color aColor;
+ Aspect_TypeOfLine aType;
+ Standard_Real aWidth;
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
- LA->LineAspect()->Aspect()->Values(acolor, atype, awidth);
- Handle(Graphic3d_AspectMarker3d) MarkerAsp = new Graphic3d_AspectMarker3d();
- MarkerAsp->SetType(Aspect_TOM_BALL);
- MarkerAsp->SetScale(0.8);
- MarkerAsp->SetColor(acolor);
- Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
- // symbols aux extremites de la cote
-// Graphic3d_Vertex V3d,V3d1,V3d2;
- Graphic3d_Vertex V3d,V3d1;
+ LA->LineAspect()->Aspect()->Values(aColor, aType, aWidth);
+ Handle(Graphic3d_AspectMarker3d) aMarkerAsp = new Graphic3d_AspectMarker3d (Aspect_TOM_O, aColor, 1.0);
+ Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAsp);
switch(ArrowSide) {
case DsgPrs_AS_NONE:
case DsgPrs_AS_FIRSTPT:
{
- V3d = Graphic3d_Vertex (pt1.X(), pt1.Y(), pt1.Z());
- if(drawFromCenter)
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
-
+ if (drawFromCenter)
+ {
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (pt1.X(), pt1.Y(), pt1.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
+ }
break;
}
case DsgPrs_AS_LASTPT:
{
// On dessine un rond
- V3d = Graphic3d_Vertex (pt2.X(), pt2.Y(), pt2.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
-
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (pt2.X(), pt2.Y(), pt2.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
break;
}
case DsgPrs_AS_BOTHPT:
{
- V3d1 = Graphic3d_Vertex (pt1.X(), pt1.Y(), pt1.Z());
- if(drawFromCenter)
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d1);
- Graphic3d_Vertex V3d2(pt2.X(), pt2.Y(), pt2.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d2);
-
+ if (drawFromCenter)
+ {
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints1 = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints1->AddVertex (pt1.X(), pt1.Y(), pt1.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints1);
+ }
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints2 = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints2->AddVertex (pt2.X(), pt2.Y(), pt2.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints2);
break;
}
{
// an Arrow
Prs3d_Arrow::Draw (aPresentation,
- pt1,
- dir1,
- LA->Arrow1Aspect()->Angle(),
- LA->Arrow1Aspect()->Length());
+ pt1,
+ dir1,
+ LA->Arrow1Aspect()->Angle(),
+ LA->Arrow1Aspect()->Length());
// a Round
- V3d = Graphic3d_Vertex (pt2.X(), pt2.Y(), pt2.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
-
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (pt2.X(), pt2.Y(), pt2.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
break;
}
case DsgPrs_AS_FIRSTPT_LASTAR:
{
// a Round
- V3d = Graphic3d_Vertex (pt1.X(), pt1.Y(), pt1.Z());
- if(drawFromCenter)
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
+ if (drawFromCenter)
+ {
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (pt1.X(), pt1.Y(), pt1.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
+ }
// an Arrow
Prs3d_Arrow::Draw (aPresentation,
- pt2,
- dir2,
- LA->Arrow1Aspect()->Angle(),
- LA->Arrow1Aspect()->Length());
+ pt2,
+ dir2,
+ LA->Arrow1Aspect()->Angle(),
+ LA->Arrow1Aspect()->Length());
break;
}
}
#include <Graphic3d_Group.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Prs3d_LengthAspect.hxx>
// On ajoute un rond au point d'attache
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
- Handle(Graphic3d_AspectMarker3d) MarkerAsp = new Graphic3d_AspectMarker3d();
- MarkerAsp->SetType(Aspect_TOM_BALL);
- MarkerAsp->SetScale(0.8);
- Quantity_Color acolor;
- Aspect_TypeOfLine atype;
- Standard_Real awidth;
- LA->LineAspect()->Aspect()->Values(acolor, atype, awidth);
- MarkerAsp->SetColor(acolor);
- Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
- Graphic3d_Vertex V3d(aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
+ Quantity_Color aColor;
+ Aspect_TypeOfLine aType;
+ Standard_Real aWidth;
+ LA->LineAspect()->Aspect()->Values (aColor, aType, aWidth);
+ Handle(Graphic3d_AspectMarker3d) aMarkerAsp = new Graphic3d_AspectMarker3d (Aspect_TOM_O, aColor, 1.0);
+ Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAsp);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
}
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_LengthAspect.hxx>
// On ajoute un rond au point d'attache
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
- Handle(Graphic3d_AspectMarker3d) MarkerAsp = new Graphic3d_AspectMarker3d();
- MarkerAsp->SetType(Aspect_TOM_BALL);
- MarkerAsp->SetScale(0.8);
- Quantity_Color acolor;
- Aspect_TypeOfLine atype;
- Standard_Real awidth;
- LA->LineAspect()->Aspect()->Values(acolor, atype, awidth);
- MarkerAsp->SetColor(acolor);
- Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
- Graphic3d_Vertex V3d(aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
+ Quantity_Color aColor;
+ Aspect_TypeOfLine aType;
+ Standard_Real aWidth;
+ LA->LineAspect()->Aspect()->Values (aColor, aType, aWidth);
+ Handle(Graphic3d_AspectMarker3d) aMarkerAsp = new Graphic3d_AspectMarker3d (Aspect_TOM_O, aColor, 1.0);
+ Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAsp);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
// texte
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
#include <Graphic3d_Group.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_ArrowAspect.hxx>
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
// ball 1 : 3eme groupe
- Handle(Graphic3d_AspectMarker3d) MarkerAsp = new Graphic3d_AspectMarker3d();
- MarkerAsp->SetType(Aspect_TOM_BALL);
- MarkerAsp->SetScale(0.8);
- Quantity_Color acolor;
- Aspect_TypeOfLine atype;
- Standard_Real awidth;
- LA->LineAspect()->Aspect()->Values(acolor, atype, awidth);
- MarkerAsp->SetColor(acolor);
- Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
- Graphic3d_Vertex V3d(Proj2.X() ,Proj2.Y(), Proj2.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
-
+ Quantity_Color aColor;
+ Aspect_TypeOfLine aType;
+ Standard_Real aWidth;
+ LA->LineAspect()->Aspect()->Values (aColor, aType, aWidth);
+ Handle(Graphic3d_AspectMarker3d) aMarkerAsp = new Graphic3d_AspectMarker3d (Aspect_TOM_O, aColor, 1.0);
+ Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAsp);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (Proj2.X(), Proj2.Y(), Proj2.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
+
Prs3d_Root::NewGroup(aPresentation);
-
+
// texte : 4eme groupe
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
}
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// anneau : 3eme et 4eme groupes
- Graphic3d_Vertex V3d(Proj2.X() ,Proj2.Y(), Proj2.Z());
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (Proj2.X(), Proj2.Y(), Proj2.Z());
Prs3d_Root::NewGroup(aPresentation);
Handle(Graphic3d_AspectMarker3d) MarkerAsp = new Graphic3d_AspectMarker3d();
//MarkerAsp->SetColor(Quantity_Color(Quantity_NOC_RED));
MarkerAsp->SetColor(acolor);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
Prs3d_Root::NewGroup(aPresentation);
Handle(Graphic3d_AspectMarker3d) Marker2Asp = new Graphic3d_AspectMarker3d();
//Marker2Asp->SetColor(Quantity_Color(Quantity_NOC_GREEN));
Marker2Asp->SetColor(acolor);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(Marker2Asp);
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
}
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Prs3d_Arrow.hxx>
// SYMMETRY WHEN THE REFERENCE POINT IS ON THE AXIS OF SYM.:
//==============================================================
//Marker of localisation of the face
- Handle(Graphic3d_AspectMarker3d) MarkerAsp = new Graphic3d_AspectMarker3d();
- MarkerAsp->SetType(Aspect_TOM_BALL);
- MarkerAsp->SetScale(0.8);
- Quantity_Color acolor;
- Aspect_TypeOfLine atype;
- Standard_Real awidth;
- LA->LineAspect()->Aspect()->Values(acolor, atype, awidth);
- MarkerAsp->SetColor(acolor);
- Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
- Graphic3d_Vertex V3d(AttachmentPoint1.X(),AttachmentPoint1.Y(),AttachmentPoint1.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
+ Quantity_Color aColor;
+ Aspect_TypeOfLine aType;
+ Standard_Real aWidth;
+ LA->LineAspect()->Aspect()->Values(aColor, aType, aWidth);
+ Handle(Graphic3d_AspectMarker3d) aMarkerAsp = new Graphic3d_AspectMarker3d (Aspect_TOM_O, aColor, 1.0);
+ Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAsp);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (AttachmentPoint1.X(), AttachmentPoint1.Y(), AttachmentPoint1.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
+
//Trace of the linking segment
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
- Handle(Graphic3d_AspectMarker3d) MarkerAspAtt = new Graphic3d_AspectMarker3d();
- MarkerAspAtt->SetType(Aspect_TOM_BALL);
- MarkerAspAtt->SetScale(0.8);
- Quantity_Color color;
- Aspect_TypeOfLine type;
- Standard_Real width;
- LA->LineAspect()->Aspect()->Values(color, type, width);
- MarkerAspAtt->SetColor(color);
- Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAspAtt);
- Graphic3d_Vertex Vatt1(AttachmentPoint1.X(),AttachmentPoint1.Y(),AttachmentPoint1.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(Vatt1);
+ Quantity_Color aColor;
+ Aspect_TypeOfLine aType;
+ Standard_Real aWidth;
+ LA->LineAspect()->Aspect()->Values (aColor, aType, aWidth);
+ Handle(Graphic3d_AspectMarker3d) aMarkerAspAtt = new Graphic3d_AspectMarker3d (Aspect_TOM_O, aColor, 1.0);
+ Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAspAtt);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints1 = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints1->AddVertex (AttachmentPoint1.X(), AttachmentPoint1.Y(), AttachmentPoint1.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints1);
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
- Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAspAtt);
- Graphic3d_Vertex Vatt2(AttachmentPoint2.X(),AttachmentPoint2.Y(),AttachmentPoint2.Z());
- Prs3d_Root::CurrentGroup(aPresentation)->Marker(Vatt2);
+ Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAspAtt);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints2 = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints2->AddVertex (AttachmentPoint2.X(), AttachmentPoint2.Y(), AttachmentPoint2.Z());
+ Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints2);
//-------------------------------------------------------------------------------------
//| SYMBOL OF SYMMETRY |
Graphic3d_Group.pxx
Graphic3d_Group_1.cxx
Graphic3d_Group_2.cxx
-Graphic3d_Group_3.cxx
Graphic3d_Group_8.cxx
Graphic3d_Group_10.cxx
Graphic3d_Structure.pxx
Graphic3d_Vec4.hxx
Graphic3d_Vertex.hxx
Graphic3d_Vertex.cxx
+Graphic3d_MarkerImage.hxx
+Graphic3d_MarkerImage.cxx
+Graphic3d_MarkerImage_Handle.hxx
\ No newline at end of file
enumeration TypeOfTextureMode is TOTM_OBJECT,
TOTM_SPHERE,
TOTM_EYE,
- TOTM_MANUAL;
+ TOTM_MANUAL,
+ TOTM_SPRITE;
---Purpose: Type of the texture projection.
---Category: Enumerations
imported CTransPersStruct;
imported TransModeFlags;
+
+ imported MarkerImage;
+ imported MarkerImage_Handle;
primitive PtrFrameBuffer;
primitive Vec2;
is
- -- constructor
- Create (
- maxVertexs: Integer from Standard)
- returns mutable ArrayOfPoints from Graphic3d;
- ---Purpose: Creates an array of points,
- -- a single pixel point is drawn at each vertex.
- -- The array must be filled using only
- -- the AddVertex(Point) method.
+ -- constructor
+ Create (maxVertexs: Integer from Standard;
+ hasVColors: Boolean from Standard = Standard_False)
+ returns mutable ArrayOfPoints from Graphic3d;
+ ---Purpose: Creates an array of points,
+ -- a single pixel point is drawn at each vertex.
+ -- The array must be filled using the AddVertex(Point) method.
+ -- When <hasVColors> is TRUE , you must use only AddVertex(Point,Color) method.
end;
#include <Graphic3d_ArrayOfPoints.ixx>
-Graphic3d_ArrayOfPoints :: Graphic3d_ArrayOfPoints (
- const Standard_Integer maxVertexs)
- : Graphic3d_ArrayOfPrimitives(Graphic3d_TOPA_POINTS,maxVertexs,0,0,Standard_False,Standard_False,Standard_False,Standard_False,Standard_False) {}
+Graphic3d_ArrayOfPoints :: Graphic3d_ArrayOfPoints (const Standard_Integer maxVertexs,
+ const Standard_Boolean hasVColors)
+: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_POINTS, maxVertexs, 0, 0, Standard_False, hasVColors, Standard_False, Standard_False, Standard_False)
+{}
class AspectMarker3d from Graphic3d inherits AspectMarker from Aspect
- ---Version:
+ ---Version:
- ---Purpose: Creates and updates an attribute group for
- -- marker type primitives. This group contains the type
- -- of marker, its colour, and its scale factor.
- ---Keywords: Marker, Color, Scale, Type
+ ---Purpose: Creates and updates an attribute group for
+ -- marker type primitives. This group contains the type
+ -- of marker, its colour, and its scale factor.
+ ---Keywords: Marker, Color, Scale, Type
- ---Warning:
- ---References:
+ ---Warning:
+ ---References:
uses
- Color from Quantity,
-
- TypeOfMarker from Aspect,
-
- HArray1OfByte from TColStd
+ Color from Quantity,
+ TypeOfMarker from Aspect,
+ HArray1OfByte from TColStd,
+ PixMap_Handle from Image,
+ MarkerImage_Handle from Graphic3d
is
- Create
- returns mutable AspectMarker3d from Graphic3d;
- ---Level: Public
- ---Purpose: Creates a context table for marker primitives
- -- defined with the following default values:
- --
- -- Marker type : TOM_X
- -- Colour : YELLOW
- -- Scale factor : 1.0
-
- Create ( AType : TypeOfMarker from Aspect;
- AColor : Color from Quantity;
- AScaleOrId : Real from Standard
- )
- returns mutable AspectMarker3d from Graphic3d;
-
- Create ( AType : TypeOfMarker from Aspect;
- AColor : Color from Quantity;
- AScaleOrId : Real from Standard;
- AWidth : Integer from Standard;
- AHeight : Integer from Standard;
- ATexture : HArray1OfByte from TColStd
- )
- returns mutable AspectMarker3d from Graphic3d;
- ---Level: Public
- ---Purpose: Creates a context table for marker primitives
- -- defined with the specified values.
-
- GetTextureSize (me:mutable; AWidth : out Integer from Standard;
- AHeight : out Integer from Standard);
- ---Level: Public
- ---Purpose: Returns marker's texture size.
-
- GetTexture (me:mutable)
- returns HArray1OfByte from TColStd;
- ---Level: Public
- ---Purpose: Returns marker's texture.
- ---C++: return const &
-
- SetTexture ( me: mutable;
- AWidth : Integer from Standard;
- AHeight : Integer from Standard;
- ATexture : HArray1OfByte from TColStd ) is static;
-
---
+ Create
+ returns mutable AspectMarker3d from Graphic3d;
+ ---Level: Public
+ ---Purpose: Creates a context table for marker primitives
+ -- defined with the following default values:
+ --
+ -- Marker type : TOM_X
+ -- Colour : YELLOW
+ -- Scale factor: 1.0
+
+ Create (theType : TypeOfMarker from Aspect;
+ theColor : Color from Quantity;
+ theScale : Real from Standard)
+ returns mutable AspectMarker3d from Graphic3d;
+
+ Create (theColor : Color from Quantity;
+ theWidth : Integer from Standard;
+ theHeight : Integer from Standard;
+ theTextureBitmap : HArray1OfByte from TColStd)
+ returns mutable AspectMarker3d from Graphic3d;
+ ---Level: Public
+ ---Purpose: Creates a context table for marker primitives
+ -- defined with the specified values.
+
+ Create (theTextureImage : PixMap_Handle from Image)
+ returns mutable AspectMarker3d from Graphic3d;
+ ---Level: Public
+ ---Purpose: Creates a context table for marker primitives
+ -- defined with the specified values.
+
+ GetTextureSize (me;
+ theWidth : out Integer from Standard;
+ theHeight: out Integer from Standard);
+ ---Level: Public
+ ---Purpose: Returns marker's texture size.
+
+ GetMarkerImage (me)
+ returns MarkerImage_Handle from Graphic3d;
+ ---Level: Public
+ ---Purpose: Returns marker's image texture.
+ --- Could be null handle if marker aspect has been initialized as
+ --- default type of marker.
+ ---C++: return const &
+
+ SetBitMap (me: mutable;
+ theWidth : Integer from Standard;
+ theHeight : Integer from Standard;
+ theTexture: HArray1OfByte from TColStd ) is static;
fields
--
--- Class : Graphic3d_AspectMarker3d
+-- Class: Graphic3d_AspectMarker3d
--
--- Purpose : Declaration of context-specific variables
--- for drawing 3d markers.
+-- Purpose: Declaration of context-specific variables
+-- for drawing 3d markers.
--
--- Reminder : A context for drawing 3d markers inherits:
--- - the colour
--- - the type of marker
--- - the scale factor
--- defined by AspectMarker.
-
- MyTexture : HArray1OfByte from TColStd is protected;
- MyTextureWidth : Integer from Standard is protected;
- MyTextureHeight : Integer from Standard is protected;
-
+-- Reminder: A context for drawing 3d markers inherits:
+-- - the colour
+-- - the type of marker
+-- - the scale factor
+-- defined by AspectMarker.
+
+myMarkerImage : MarkerImage_Handle from Graphic3d is protected;
+
end AspectMarker3d;
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
-
-//-Version
-
-//-Design Declaration of variables specific to the context
-// of trace of markers 3d
-
-// Rappels Context of trace of markers 3d inherits the context
-// defined by :
-// - the color
-// - the type of marker
-// - the scale
-
-//-Warning
-
-//-References
-
-//-Language C++ 2.0
-
-//-Declarations
-
-// for the class
#include <Graphic3d_AspectMarker3d.ixx>
#include <TColStd_Array1OfByte.hxx>
-
-//-Aliases
-
-//-Global data definitions
-
-//-Constructors
-
-//-Destructors
-
-//-Methods, in order
-
-Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d ()
- :Aspect_AspectMarker(), MyTextureWidth(0), MyTextureHeight(0)
-{
-}
-
-Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Aspect_TypeOfMarker AType, const Quantity_Color& AColor, const Standard_Real AScaleOrId ):
-Aspect_AspectMarker( AColor, AType, AScaleOrId ), MyTextureWidth(0), MyTextureHeight(0)
-{
-}
-
-
-Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Aspect_TypeOfMarker AType,
- const Quantity_Color& AColor,
- const Standard_Real AScaleOrId,
- const Standard_Integer AWidth,
- const Standard_Integer AHeight,
- const Handle(TColStd_HArray1OfByte)& ATexture ):
-Aspect_AspectMarker( AColor, AType, AScaleOrId ), MyTexture( ATexture ), MyTextureWidth(AWidth), MyTextureHeight(AHeight)
-{
- /*for( Standard_Integer aIndex = ATexture.Lower(); aIndex <= ATexture.Upper(); aIndex++ )
- {
- MyTexture.SetValue( aIndex, ATexture.Value( aIndex ) );
- }
- */
-
-}
-
-void Graphic3d_AspectMarker3d::GetTextureSize(Standard_Integer& AWidth, Standard_Integer& AHeight)
+#include <Image_PixMap.hxx>
+#include <Graphic3d_MarkerImage.hxx>
+
+// =======================================================================
+// function : Graphic3d_AspectMarker3d
+// purpose :
+// =======================================================================
+Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d()
+: Aspect_AspectMarker()
+{}
+
+// =======================================================================
+// function : Graphic3d_AspectMarker3d
+// purpose :
+// =======================================================================
+Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Aspect_TypeOfMarker theType,
+ const Quantity_Color& theColor,
+ const Standard_Real theScale)
+: Aspect_AspectMarker (theColor, theType, theScale)
+{}
+
+// =======================================================================
+// function : Graphic3d_AspectMarker3d
+// purpose :
+// =======================================================================
+Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Quantity_Color& theColor,
+ const Standard_Integer theWidth,
+ const Standard_Integer theHeight,
+ const Handle(TColStd_HArray1OfByte)& theTextureBitMap)
+: Aspect_AspectMarker (theColor, Aspect_TOM_USERDEFINED, 1.0),
+ myMarkerImage (new Graphic3d_MarkerImage (theTextureBitMap, theWidth, theHeight))
+{}
+
+// =======================================================================
+// function : Graphic3d_AspectMarker3d
+// purpose :
+// =======================================================================
+Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Handle(Image_PixMap)& theTextureImage)
+: Aspect_AspectMarker (Quantity_NOC_YELLOW, Aspect_TOM_USERDEFINED, 1.0),
+ myMarkerImage (new Graphic3d_MarkerImage (theTextureImage))
+{}
+
+// =======================================================================
+// function : GetTextureSize
+// purpose :
+// =======================================================================
+void Graphic3d_AspectMarker3d::GetTextureSize (Standard_Integer& theWidth,
+ Standard_Integer& theHeight) const
{
- AWidth = MyTextureWidth;
- AHeight = MyTextureHeight;
+ if (!myMarkerImage.IsNull())
+ {
+ myMarkerImage->GetTextureSize (theWidth, theHeight);
+ }
+ else
+ {
+ theWidth = 0;
+ theHeight = 0;
+ }
}
-const Handle(TColStd_HArray1OfByte)& Graphic3d_AspectMarker3d::GetTexture()
+// =======================================================================
+// function : GetMarkerImage
+// purpose :
+// =======================================================================
+const Handle(Graphic3d_MarkerImage)& Graphic3d_AspectMarker3d::GetMarkerImage() const
{
- return MyTexture;
+ return myMarkerImage;
}
-void Graphic3d_AspectMarker3d::SetTexture (const Standard_Integer AWidth,
- const Standard_Integer AHeight,
- const Handle(TColStd_HArray1OfByte)& ATexture )
+// =======================================================================
+// function : SetBitMap
+// purpose :
+// =======================================================================
+void Graphic3d_AspectMarker3d::SetBitMap (const Standard_Integer theWidth,
+ const Standard_Integer theHeight,
+ const Handle(TColStd_HArray1OfByte)& theTextureBitMap)
{
- MyTextureWidth = AWidth;
- MyTextureHeight = AHeight;
-
- MyTexture = ATexture;
+ myMarkerImage.Nullify();
+ myMarkerImage = new Graphic3d_MarkerImage (theTextureBitMap, theWidth, theHeight);
}
#ifndef _Graphic3d_CGroup_HeaderFile
#define _Graphic3d_CGroup_HeaderFile
+#include <Aspect_TypeOfMarker.hxx>
#include <InterfaceGraphic_Visual3d.hxx>
#include <Graphic3d_CTexture.hxx>
+#include <Graphic3d_MarkerImage_Handle.hxx>
class Graphic3d_CStructure;
};
+class CALL_DEF_CONTEXTMARKER
+{
+public:
+
+ CALL_DEF_CONTEXTMARKER()
+ : IsDef (0),
+ IsSet (0),
+ MarkerType (Aspect_TOM_POINT),
+ Scale (0),
+ MarkerImage (NULL)
+ {
+ //
+ }
+
+public:
+
+ Standard_Integer IsDef;
+ Standard_Integer IsSet;
+ CALL_DEF_COLOR Color;
+ Aspect_TypeOfMarker MarkerType;
+ Standard_ShortReal Scale;
+ Handle(Graphic3d_MarkerImage) MarkerImage;
+
+};
+
class Graphic3d_CGroup
{
is deferred;
---Purpose:
- ----------------------------------------
- -- Category: Methods to create Marker
- -- for Purpose : see Graphic3d_Group.cdl
- ----------------------------------------
-
- Marker ( me : mutable;
- ACGroup : CGroup from Graphic3d;
- APoint : Vertex from Graphic3d )
- is deferred;
-
- MarkerSet ( me : mutable;
- ACGroup : CGroup from Graphic3d;
- ListVertex : Array1OfVertex from Graphic3d )
- is deferred;
-
----------------------------------------
-- Category: Methods to create Text
-- for Purpose : see Graphic3d_Group.cdl
---Purpose: Sets the coordinates of the boundary box of the
-- group <me>.
---Category: Methods to modify the class definition
-
- -------------------------------------
- -- Category: Methods to create Marker
- -------------------------------------
-
- ---------------------------------------------
- -- Summary of Markers --
- -- --
- -- They should have one or more vertices. --
- -- --
- -- They have the following attributes. --
- -- --
- -- Marker Type. --
- -- Marker Scale Factor. --
- -- Marker Color. --
- -- --
- -- The size, shape and orientation of a --
- -- marker is not subject to transformation --
- ---------------------------------------------
-
- Marker ( me : mutable;
- APoint : Vertex from Graphic3d;
- EvalMinMax : Boolean from Standard = Standard_True )
- is static;
- ---Level: Public
- ---Purpose: Creates a marker in position <APoint> which will be drawn
- -- with the current attribute (AspectMarker).
- ---Category: Methods to create Marker
-
- MarkerSet ( me : mutable;
- ListVertex : Array1OfVertex from Graphic3d;
- EvalMinMax : Boolean from Standard = Standard_True )
- is static;
- ---Purpose: Creates a group of markers defined by a table of
- -- vertices.
- ---Category: Methods to create Marker
-
+
-----------------------------------
-- Category: Methods to create Text
-----------------------------------
+++ /dev/null
-// Created by: NW,JPB,CAL
-// Copyright (c) 1991-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.
-
-
-
-
-//-Version
-
-//-Design Declaration des variables specifiques aux groupes
-// de primitives
-
-//-Warning Un groupe est defini dans une structure
-// Il s'agit de la plus petite entite editable
-
-//-References
-
-//-Language C++ 2.0
-
-//-Declarations
-
-// for the class
-#include <Graphic3d_Group.jxx>
-#include <Graphic3d_Group.pxx>
-
-//-Methods, in order
-
-void Graphic3d_Group::Marker (const Graphic3d_Vertex &APoint, const Standard_Boolean EvalMinMax)
-{
- if (IsDeleted ()) return;
-
- MyIsEmpty = Standard_False;
-
- // Min-Max Update
- if (EvalMinMax) {
- Standard_ShortReal X, Y, Z;
- APoint.Coord (X, Y, Z);
- if (X < MyBounds.XMin) MyBounds.XMin = X;
- if (Y < MyBounds.YMin) MyBounds.YMin = Y;
- if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
- if (X > MyBounds.XMax) MyBounds.XMax = X;
- if (Y > MyBounds.YMax) MyBounds.YMax = Y;
- if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
- }
-
- MyGraphicDriver->Marker (MyCGroup, APoint);
-
- Update ();
-}
-
-void Graphic3d_Group::MarkerSet (const Graphic3d_Array1OfVertex &ListVertex, const Standard_Boolean EvalMinMax)
-{
- if (IsDeleted ()) return;
-
- MyIsEmpty = Standard_False;
-
- // Min-Max Update
- if (EvalMinMax) {
- Standard_ShortReal X, Y, Z;
- Standard_Integer i = ListVertex.Lower ();
- const Standard_Integer Upper = ListVertex.Upper ();
- // Parcours des sommets
- for (; i<=Upper; i++) {
- ListVertex (i).Coord (X, Y, Z);
- if (X < MyBounds.XMin) MyBounds.XMin = X;
- if (Y < MyBounds.YMin) MyBounds.YMin = Y;
- if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
- if (X > MyBounds.XMax) MyBounds.XMax = X;
- if (Y > MyBounds.YMax) MyBounds.YMax = Y;
- if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
- }
- }
-
- MyGraphicDriver->MarkerSet (MyCGroup, ListVertex);
-
- Update ();
-}
}
-void Graphic3d_Group::SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX) {
-
- if (IsDeleted ()) return;
+void Graphic3d_Group::SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& theCtx)
+{
+ if (IsDeleted()) return;
- Standard_Real R, G, B;
- Standard_Real AScale;
- Quantity_Color AColor;
- Aspect_TypeOfMarker AMType;
+ Standard_Real aRed, aGreen, aBlue;
+ Standard_Real aScale;
+ Quantity_Color aColor;
+ Aspect_TypeOfMarker aMarkerType;
- CTX->Values (AColor, AMType, AScale);
- AColor.Values (R, G, B, Quantity_TOC_RGB);
+ theCtx->Values (aColor, aMarkerType, aScale);
+ aColor.Values (aRed, aGreen, aBlue, Quantity_TOC_RGB);
- MyCGroup.ContextMarker.Color.r = float (R);
- MyCGroup.ContextMarker.Color.g = float (G);
- MyCGroup.ContextMarker.Color.b = float (B);
- MyCGroup.ContextMarker.MarkerType = int (AMType);
- MyCGroup.ContextMarker.Scale = float (AScale);
- MyCGroup.ContextMarker.IsDef = 1;
+ MyCGroup.ContextMarker.IsDef = 1;
+ MyCGroup.ContextMarker.Color.r = Standard_ShortReal (aRed);
+ MyCGroup.ContextMarker.Color.g = Standard_ShortReal (aGreen);
+ MyCGroup.ContextMarker.Color.b = Standard_ShortReal (aBlue);
+ MyCGroup.ContextMarker.MarkerType = aMarkerType;
+ MyCGroup.ContextMarker.Scale = Standard_ShortReal (aScale);
+ MyCGroup.ContextMarker.MarkerImage = theCtx->GetMarkerImage();
- int noinsert = 1;
- if ( AMType == Aspect_TOM_USERDEFINED )
- {
- CTX->GetTextureSize( MyMarkWidth, MyMarkHeight );
- MyMarkArray = CTX->GetTexture();
- MyGraphicDriver->MarkerContextGroup (MyCGroup, noinsert, MyMarkWidth, MyMarkHeight, MyMarkArray);
- }
- else
- MyGraphicDriver->MarkerContextGroup (MyCGroup, noinsert);
-
- MyCGroup.ContextMarker.IsSet = 1;
+ int noinsert = 1;
+ MyGraphicDriver->MarkerContextGroup (MyCGroup, noinsert);
- Update ();
+ MyCGroup.ContextMarker.IsSet = 1;
+ Update();
}
void Graphic3d_Group::SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX) {
}
-void Graphic3d_Group::SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX) {
-
- if (IsDeleted ()) return;
-
- Standard_Real R, G, B;
- Standard_Real AScale;
- Quantity_Color AColor;
- Aspect_TypeOfMarker AMType;
+void Graphic3d_Group::SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& thCtx)
+{
+ if (IsDeleted()) return;
- CTX->Values (AColor, AMType, AScale);
- AColor.Values (R, G, B, Quantity_TOC_RGB);
+ Standard_Real aRed, aGreen, aBlue;
+ Standard_Real aScale;
+ Quantity_Color aColor;
+ Aspect_TypeOfMarker aMarkerType;
- MyCGroup.ContextMarker.Color.r = float (R);
- MyCGroup.ContextMarker.Color.g = float (G);
- MyCGroup.ContextMarker.Color.b = float (B);
- MyCGroup.ContextMarker.MarkerType = int (AMType);
- MyCGroup.ContextMarker.Scale = float (AScale);
- MyCGroup.ContextMarker.IsDef = 1;
+ thCtx->Values (aColor, aMarkerType, aScale);
+ aColor.Values (aRed, aGreen, aBlue, Quantity_TOC_RGB);
- int noinsert = 0;
- if ( AMType == Aspect_TOM_USERDEFINED )
- {
- CTX->GetTextureSize( MyMarkWidth, MyMarkHeight );
- MyMarkArray = CTX->GetTexture();
- MyGraphicDriver->MarkerContextGroup (MyCGroup, noinsert, MyMarkWidth, MyMarkHeight, MyMarkArray);
- }
- else
- MyGraphicDriver->MarkerContextGroup (MyCGroup, noinsert);
+ MyCGroup.ContextMarker.IsDef = 1;
+ MyCGroup.ContextMarker.Color.r = Standard_ShortReal (aRed);
+ MyCGroup.ContextMarker.Color.g = Standard_ShortReal (aGreen);
+ MyCGroup.ContextMarker.Color.b = Standard_ShortReal (aBlue);
+ MyCGroup.ContextMarker.MarkerType = aMarkerType;
+ MyCGroup.ContextMarker.Scale = Standard_ShortReal (aScale);
+ MyCGroup.ContextMarker.MarkerImage = thCtx->GetMarkerImage();
- MyCGroup.ContextMarker.IsSet = 1;
+ int noinsert = 0;
+ MyGraphicDriver->MarkerContextGroup (MyCGroup, noinsert);
- Update ();
+ MyCGroup.ContextMarker.IsSet = 1;
+ Update();
}
void Graphic3d_Group::SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX) {
R = Standard_Real (MyCGroup.ContextMarker.Color.r);
G = Standard_Real (MyCGroup.ContextMarker.Color.g);
B = Standard_Real (MyCGroup.ContextMarker.Color.b);
- AMType = Aspect_TypeOfMarker (MyCGroup.ContextMarker.MarkerType);
+ AMType = MyCGroup.ContextMarker.MarkerType;
AScale = Standard_Real (MyCGroup.ContextMarker.Scale);
if( AMType == Aspect_TOM_USERDEFINED )
{
- CTXM->SetTexture( MyMarkWidth, MyMarkHeight, MyMarkArray );
+ CTXM->SetBitMap( MyMarkWidth, MyMarkHeight, MyMarkArray );
}
}
else {
R = Standard_Real (MyCGroup.Struct->ContextMarker.Color.r);
G = Standard_Real (MyCGroup.Struct->ContextMarker.Color.g);
B = Standard_Real (MyCGroup.Struct->ContextMarker.Color.b);
- AMType = Aspect_TypeOfMarker (MyCGroup.Struct->ContextMarker.MarkerType);
+ AMType = MyCGroup.Struct->ContextMarker.MarkerType;
AScale = Standard_Real (MyCGroup.Struct->ContextMarker.Scale);
}
AColor.SetValues (R, G, B, Quantity_TOC_RGB);
--- /dev/null
+// Created on: 2013-06-25
+// Created by: Dmitry BOBYLEV
+// Copyright (c) 2013 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 <Graphic3d_MarkerImage.hxx>
+
+#include <Image_PixMap.hxx>
+#include <Standard_Atomic.hxx>
+#include <TColStd_HArray1OfByte.hxx>
+
+namespace
+{
+ static volatile Standard_Integer THE_MARKER_IMAGE_COUNTER = 0;
+};
+
+IMPLEMENT_STANDARD_HANDLE (Graphic3d_MarkerImage, Standard_Transient)
+IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_MarkerImage, Standard_Transient)
+
+// =======================================================================
+// function : Graphic3d_MarkerImage
+// purpose :
+// =======================================================================
+Graphic3d_MarkerImage::Graphic3d_MarkerImage (const Handle(Image_PixMap)& theImage)
+: myBitMap (NULL),
+ myImage (theImage),
+ myImageAlpha (NULL),
+ myMargin (1),
+ myWidth ((Standard_Integer )theImage->Width()),
+ myHeight ((Standard_Integer )theImage->Height())
+{
+ myImageId = TCollection_AsciiString ("Graphic3d_MarkerImage_")
+ + TCollection_AsciiString (Standard_Atomic_Increment (&THE_MARKER_IMAGE_COUNTER));
+
+ myImageAlphaId = TCollection_AsciiString ("Graphic3d_MarkerImageAlpha_")
+ + TCollection_AsciiString (THE_MARKER_IMAGE_COUNTER);
+}
+
+// =======================================================================
+// function : Graphic3d_MarkerImage
+// purpose :
+// =======================================================================
+Graphic3d_MarkerImage::Graphic3d_MarkerImage (const Handle(TColStd_HArray1OfByte)& theBitMap,
+ const Standard_Integer& theWidth,
+ const Standard_Integer& theHeight)
+: myBitMap (theBitMap),
+ myImage (NULL),
+ myImageAlpha (NULL),
+ myMargin (1),
+ myWidth (theWidth),
+ myHeight (theHeight)
+{
+ myImageId = TCollection_AsciiString ("Graphic3d_MarkerImage_")
+ + TCollection_AsciiString (Standard_Atomic_Increment (&THE_MARKER_IMAGE_COUNTER));
+
+ myImageAlphaId = TCollection_AsciiString ("Graphic3d_MarkerImageAlpha_")
+ + TCollection_AsciiString (THE_MARKER_IMAGE_COUNTER);
+}
+
+// =======================================================================
+// function : GetBitMapArray
+// purpose :
+// =======================================================================
+Handle(TColStd_HArray1OfByte) Graphic3d_MarkerImage::GetBitMapArray (const Standard_Real& theAlphaValue) const
+{
+ if (!myBitMap.IsNull())
+ {
+ return myBitMap;
+ }
+
+ Handle(TColStd_HArray1OfByte) aBitMap;
+ if (myImage.IsNull())
+ {
+ return aBitMap;
+ }
+
+ const Standard_Integer aNumOfBytesInRow = (Standard_Integer )(myImage->Width() / 8) + (myImage->Width() % 8 ? 1 : 0);
+ const Standard_Integer aNumOfBytes = (Standard_Integer )(aNumOfBytesInRow * myImage->Height());
+ const Standard_Integer aHeight = (Standard_Integer )myImage->Height();
+ const Standard_Integer aWidth = (Standard_Integer )myImage->Width();
+ aBitMap = new TColStd_HArray1OfByte (0, aNumOfBytes - 1);
+ aBitMap->Init (0);
+ for (Standard_Integer aRow = 0; aRow < aHeight; aRow++)
+ {
+ for (Standard_Integer aColumn = 0; aColumn < aWidth; aColumn++)
+ {
+ Quantity_Parameter anAlphaValue;
+ Quantity_Color aColor = myImage->PixelColor (aColumn, aRow, anAlphaValue);
+ Standard_Boolean aBitOn = Standard_False;
+
+ if (myImage->Format() == Image_PixMap::ImgGray)
+ {
+ aBitOn = aColor.Red() > theAlphaValue;
+ }
+ else
+ {
+ aBitOn = anAlphaValue > theAlphaValue;
+ }
+
+ aBitMap->ChangeValue (aNumOfBytesInRow * aRow + aColumn / 8) += aBitOn ? (0x80 >> (aColumn % 8)) : 0;
+ }
+ }
+
+ return aBitMap;
+}
+
+// =======================================================================
+// function : GetImage
+// purpose :
+// =======================================================================
+const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImage()
+{
+ if (!myImage.IsNull())
+ {
+ return myImage;
+ }
+
+ if (myBitMap.IsNull())
+ {
+ return myImage;
+ }
+
+ // Converting a byte array to bitmap image. Row and column offsets are used
+ // to store bitmap in a square image, so the image will not be stretched
+ // when rendering with point sprites.
+ const Standard_Integer aNumOfBytesInRow = myWidth / 8 + (myWidth % 8 ? 1 : 0);
+ const Standard_Integer aSize = Max (myWidth, myHeight);
+ const Standard_Integer aRowOffset = (aSize - myHeight) / 2 + myMargin;
+ const Standard_Integer aColumnOffset = (aSize - myWidth ) / 2 + myMargin;
+ const Standard_Integer aLowerIndex = myBitMap->Lower();
+
+ myImage = new Image_PixMap();
+ myImage->InitZero (Image_PixMap::ImgGray, aSize + myMargin * 2, aSize + myMargin * 2);
+ for (Standard_Integer aRowIter = 0; aRowIter < myHeight; aRowIter++)
+ {
+ Standard_Byte* anImageRow = myImage->ChangeRow (aRowIter + aRowOffset);
+ for (Standard_Integer aColumnIter = 0; aColumnIter < myWidth; aColumnIter++)
+ {
+ Standard_Boolean aBitOn = myBitMap->Value (aLowerIndex + aNumOfBytesInRow * aRowIter + aColumnIter / 8) & (0x80 >> (aColumnIter % 8));
+ anImageRow[aColumnIter + aColumnOffset] = aBitOn ? 255 : 0;
+ }
+ }
+
+ return myImage;
+}
+
+// =======================================================================
+// function : GetImageAlpha
+// purpose :
+// =======================================================================
+const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImageAlpha()
+{
+ if (!myImageAlpha.IsNull())
+ {
+ return myImageAlpha;
+ }
+
+ if (!myImage.IsNull())
+ {
+ if (myImage->Format() == Image_PixMap::ImgGray)
+ {
+ myImageAlpha = myImage;
+ }
+ else
+ {
+ myImageAlpha = new Image_PixMap();
+ myImageAlpha->InitZero (Image_PixMap::ImgGray, myImage->Width(), myImage->Height());
+ myImageAlpha->SetTopDown (Standard_False);
+ Quantity_Parameter anAlpha;
+ for (Standard_Integer aRowIter = 0; aRowIter < myImage->Height(); aRowIter++)
+ {
+ Standard_Byte* anImageRow = myImageAlpha->ChangeRow (aRowIter);
+ for (Standard_Integer aColumnIter = 0; aColumnIter < myImage->Width(); aColumnIter++)
+ {
+ myImage->PixelColor (aColumnIter, aRowIter, anAlpha);
+ anImageRow[aColumnIter] = Standard_Byte (255.0 * anAlpha);
+ }
+ }
+ }
+ }
+
+ return myImageAlpha;
+}
+
+// =======================================================================
+// function : GetImageId
+// purpose :
+// =======================================================================
+const TCollection_AsciiString& Graphic3d_MarkerImage::GetImageId() const
+{
+ return myImageId;
+}
+
+// =======================================================================
+// function : GetImageAlphaId
+// purpose :
+// =======================================================================
+const TCollection_AsciiString& Graphic3d_MarkerImage::GetImageAlphaId() const
+{
+ return myImageAlphaId;
+}
+
+// =======================================================================
+// function : GetTextureSize
+// purpose :
+// =======================================================================
+void Graphic3d_MarkerImage::GetTextureSize (Standard_Integer& theWidth,
+ Standard_Integer& theHeight) const
+{
+ theWidth = myWidth;
+ theHeight = myHeight;
+}
--- /dev/null
+// Created on: 2013-06-25
+// Created by: Dmitry BOBYLEV
+// Copyright (c) 2013 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.
+
+#ifndef _Graphic3d_MarkerImage_H__
+#define _Graphic3d_MarkerImage_H__
+
+#include <Graphic3d_MarkerImage_Handle.hxx>
+
+#include <Handle_TColStd_HArray1OfByte.hxx>
+#include <Image_PixMap_Handle.hxx>
+#include <Quantity_Parameter.hxx>
+#include <TCollection_AsciiString.hxx>
+
+//! This class is used to store bitmaps and images for markers rendering.
+//! It can convert bitmap texture stored in TColStd_HArray1OfByte to Image_PixMap and vice versa.
+class Graphic3d_MarkerImage : public Standard_Transient
+{
+public:
+
+ //! @param theImage - source image
+ Standard_EXPORT Graphic3d_MarkerImage (const Handle(Image_PixMap)& theImage);
+
+ //! Creates marker image from array of bytes
+ //! (method for compatibility with old markers definition).
+ //! @param theBitMap - source bitmap stored as array of bytes
+ //! @param theWidth - number of bits in a row
+ //! @param theHeight - number of bits in a column
+ Standard_EXPORT Graphic3d_MarkerImage (const Handle(TColStd_HArray1OfByte)& theBitMap,
+ const Standard_Integer& theWidth,
+ const Standard_Integer& theHeight);
+
+ //! @param theAlphaValue pixels in the image that have alpha value greater than
+ //! or equal to this parameter will be stored in bitmap as "1",
+ //! others will be stored as "0"
+ //! @return marker image as array of bytes. If an instance of the class has been
+ //! initialized with image, it will be converted to bitmap based on the parameter theAlphaValue.
+ Standard_EXPORT Handle(TColStd_HArray1OfByte) GetBitMapArray (const Standard_Real& theAlphaValue = 0.5) const;
+
+ //! @return marker image. If an instance of the class has been initialized with a bitmap, it will be
+ //! converted to image.
+ Standard_EXPORT const Handle(Image_PixMap)& GetImage();
+
+ //! @return image alpha as grayscale image. Note that if an instance of the class has been initialized
+ //! with a bitmap or with grayscale image this method will return exactly the same image as GetImage()
+ Standard_EXPORT const Handle(Image_PixMap)& GetImageAlpha();
+
+ //! @return an unique ID. This ID will be used to manage resource in graphic driver.
+ Standard_EXPORT const TCollection_AsciiString& GetImageId() const;
+
+ //! @return an unique ID. This ID will be used to manage resource in graphic driver.
+ Standard_EXPORT const TCollection_AsciiString& GetImageAlphaId() const;
+
+ //! @return texture size
+ Standard_EXPORT void GetTextureSize (Standard_Integer& theWidth,
+ Standard_Integer& theHeight) const;
+
+private:
+
+ TCollection_AsciiString myImageId; //!< resource identifier
+ TCollection_AsciiString myImageAlphaId; //!< resource identifier
+ Handle(TColStd_HArray1OfByte) myBitMap; //!< bytes array with bitmap definition (for compatibility with old code)
+ Handle(Image_PixMap) myImage; //!< full-color marker definition
+ Handle(Image_PixMap) myImageAlpha; //!< alpha-color marker definition (for dynamic hi-lighting)
+ Standard_Integer myMargin; //!< extra margin from boundaries for bitmap -> point sprite conversion, 1 px by default
+ Standard_Integer myWidth; //!< marker width
+ Standard_Integer myHeight; //!< marker height
+
+public:
+
+ DEFINE_STANDARD_RTTI(Graphic3d_MarkerImage) // Type definition
+
+};
+
+#endif // _Graphic3d_MarkerImage_H__
--- /dev/null
+// Created on: 2013-06-25
+// Created by: Dmitry BOBYLEV
+// Copyright (c) 2013 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.
+
+#ifndef _Graphic3d_TextureBitMap_Handle_H__
+#define _Graphic3d_TextureBitMap_Handle_H__
+
+#include <Standard_DefineHandle.hxx>
+#include <Handle_Standard_Transient.hxx>
+
+class Graphic3d_TextureBitMap;
+DEFINE_STANDARD_HANDLE(Graphic3d_MarkerImage, Standard_Transient)
+typedef Handle(Graphic3d_MarkerImage) Graphic3d_MarkerImage_Handle;
+
+#endif // _Graphic3d_TextureBitMap_Handle_H__
G = Standard_Real (MyCStructure.ContextMarker.Color.g);
B = Standard_Real (MyCStructure.ContextMarker.Color.b);
AColor.SetValues (R, G, B, Quantity_TOC_RGB);
- AMType = Aspect_TypeOfMarker (MyCStructure.ContextMarker.MarkerType);
+ AMType = MyCStructure.ContextMarker.MarkerType;
AScale = Standard_Real (MyCStructure.ContextMarker.Scale);
Handle(Graphic3d_AspectMarker3d) CTXM =
MyCStructure.ContextMarker.Color.r = float (R);
MyCStructure.ContextMarker.Color.g = float (G);
MyCStructure.ContextMarker.Color.b = float (B);
- MyCStructure.ContextMarker.MarkerType = int (AMType);
+ MyCStructure.ContextMarker.MarkerType = AMType;
MyCStructure.ContextMarker.Scale = float (AScale);
MyCStructure.ContextMarker.IsDef = 1;
MyCStructure.ContextMarker.Color.r = float (R);
MyCStructure.ContextMarker.Color.g = float (G);
MyCStructure.ContextMarker.Color.b = float (B);
- MyCStructure.ContextMarker.MarkerType = int (AMType);
+ MyCStructure.ContextMarker.MarkerType = AMType;
MyCStructure.ContextMarker.Scale = float (AScale);
CTXT->Values (AColor, AFont, AnExpansion, ASpace,AStyleT,ADisplayType,AColorSubTitle,ATextZoomable,ATextAngle,ATextFontAspect);
} CALL_DEF_MATERIAL;
-/* CONTEXTE MARKER */
-
-typedef struct {
-
- int IsDef;
-
- int IsSet;
-
- CALL_DEF_COLOR Color;
-
- int MarkerType;
-
- float Scale;
-
-} CALL_DEF_CONTEXTMARKER;
-
-
/* CONTEXTE TEXT */
typedef struct {
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_ArrayOfPolygons.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
#include <Graphic3d_Group.hxx>
#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
if ( upper<=0 )
return;
- Graphic3d_Array1OfVertex aNodePoints ( 1, upper );
+ Handle(Graphic3d_ArrayOfPoints) aNodePoints = new Graphic3d_ArrayOfPoints (upper);
Standard_Integer k=0;
TColStd_MapIteratorOfPackedMapOfInteger it (anIDs);
for( ; it.More(); it.Next() )
{
if ( IsExcludingOn() )
IDsToExclude.Add (aKey);
- k++;
- aNodePoints.SetValue ( k, Graphic3d_Vertex ( aCoords(1), aCoords(2), aCoords(3) ) );
+ k++;
+ aNodePoints->AddVertex (aCoords(1), aCoords(2), aCoords(3));
}
}
Prs3d_Root::NewGroup ( Prs );
Handle (Graphic3d_Group) aNodeGroup = Prs3d_Root::CurrentGroup ( Prs );
aNodeGroup->SetPrimitivesAspect ( aNodeMark );
- aNodeGroup->MarkerSet ( aNodePoints );
+ aNodeGroup->AddPrimitiveArray (aNodePoints);
}
}
{
case MeshVS_ET_Node :
{
- aHilightGroup->SetPrimitivesAspect ( aNodeMark );
- aHilightGroup->Marker ( Graphic3d_Vertex ( aCoords(1), aCoords(2), aCoords(3) ) );
+ aHilightGroup->SetPrimitivesAspect (aNodeMark);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (aCoords(1), aCoords(2), aCoords(3));
+ aHilightGroup->AddPrimitiveArray (anArrayOfPoints);
}
break;
#include <Prs3d_Root.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Graphic3d_AspectText3d.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <TColStd_ListIteratorOfListOfReal.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
continue;
}
- Graphic3d_Vertex aPoint( X, Y, Z );
-
- aTextGroup->Marker ( aPoint );
- aTextGroup->Text ( aStr.ToCString(), aPoint, aHeight );
+ Graphic3d_Vertex aPoint (X, Y, Z);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (X, Y, Z);
+ aTextGroup->AddPrimitiveArray (anArrayOfPoints);
+ aTextGroup->Text (aStr.ToCString(), aPoint, aHeight);
}
}
}
OpenGl_GraphicDriver_3.cxx
OpenGl_GraphicDriver_4.cxx
OpenGl_GraphicDriver_7.cxx
-OpenGl_GraphicDriver_703.cxx
OpenGl_GraphicDriver_713.cxx
OpenGl_GraphicDriver_Layer.cxx
OpenGl_GraphicDriver_Export.cxx
OpenGl_Text.cxx
OpenGl_TextFormatter.hxx
OpenGl_TextFormatter.cxx
-OpenGl_Marker.hxx
-OpenGl_Marker.cxx
-OpenGl_MarkerSet.hxx
-OpenGl_MarkerSet.cxx
+OpenGl_PointSprite.hxx
+OpenGl_PointSprite.cxx
+Handle_OpenGl_PointSprite.hxx
OpenGl_PrimitiveArray.hxx
OpenGl_PrimitiveArray.cxx
Handle_OpenGl_Workspace.hxx
--- /dev/null
+// Created on: 2013-08-26
+// Created by: Kirill GAVRILOV
+// Copyright (c) 2013 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.
+
+#ifndef _Handle_OpenGl_PointSprite_Header
+#define _Handle_OpenGl_PointSprite_Header
+
+#include <Handle_OpenGl_Texture.hxx>
+
+class OpenGl_PointSprite;
+DEFINE_STANDARD_HANDLE(OpenGl_PointSprite, OpenGl_Texture)
+
+#endif // _Handle_OpenGl_PointSprite_Header
// and conditions governing the rights and limitations under the License.
#include <OpenGl_AspectMarker.hxx>
+#include <OpenGl_Context.hxx>
+#include <OpenGl_GraphicDriver.hxx>
+#include <OpenGl_PointSprite.hxx>
#include <OpenGl_Workspace.hxx>
+#include <Image_PixMap.hxx>
+#include <Graphic3d_MarkerImage.hxx>
+#include <NCollection_Vec4.hxx>
+
static const TEL_COLOUR myDefaultColor = {{ 1.0F, 1.0F, 1.0F, 1.0F }};
-/*----------------------------------------------------------------------*/
+// Following Section relates to default markers
-OpenGl_AspectMarker::OpenGl_AspectMarker ()
- : myColor(myDefaultColor),
- myType(Aspect_TOM_PLUS),
- myScale(1.0F)
-{}
+#define TEL_NO_OF_SIZES 13
+#define TEL_PM_START_SIZE 1.0
+#define TEL_PM_END_SIZE 7.0
+
+struct PM_FONT_INFO
+{
+ Tfloat width, height;
+ Tint offset;
+};
+typedef PM_FONT_INFO* pm_font_info;
+
+#define PM_PLUS_10_NUM 9*2
+#define PM_PLUS_15_NUM 11*2
+#define PM_PLUS_20_NUM 13*2
+#define PM_PLUS_25_NUM 15*2
+#define PM_PLUS_30_NUM 17*3
+#define PM_PLUS_35_NUM 19*3
+#define PM_PLUS_40_NUM 21*3
+#define PM_PLUS_45_NUM 23*3
+#define PM_PLUS_50_NUM 25*4
+#define PM_PLUS_55_NUM 27*4
+#define PM_PLUS_60_NUM 29*4
+#define PM_PLUS_65_NUM 31*4
+#define PM_PLUS_70_NUM 32*4
+
+#define PM_STAR_10_NUM 9
+#define PM_STAR_15_NUM 11*2
+#define PM_STAR_20_NUM 13*2
+#define PM_STAR_25_NUM 15*2
+#define PM_STAR_30_NUM 17*2
+#define PM_STAR_35_NUM 19*2
+#define PM_STAR_40_NUM 21*3
+#define PM_STAR_45_NUM 23*3
+#define PM_STAR_50_NUM 25*3
+#define PM_STAR_55_NUM 27*3
+#define PM_STAR_60_NUM 29*4
+#define PM_STAR_65_NUM 32*4
+#define PM_STAR_70_NUM 32*4
+
+#define PM_CIRC_10_NUM 7
+#define PM_CIRC_15_NUM 9*2
+#define PM_CIRC_20_NUM 9*2
+#define PM_CIRC_25_NUM 11*2
+#define PM_CIRC_30_NUM 13*2
+#define PM_CIRC_35_NUM 15*2
+#define PM_CIRC_40_NUM 17*3
+#define PM_CIRC_45_NUM 19*3
+#define PM_CIRC_50_NUM 21*3
+#define PM_CIRC_55_NUM 23*3
+#define PM_CIRC_60_NUM 25*4
+#define PM_CIRC_65_NUM 27*4
+#define PM_CIRC_70_NUM 29*4
+
+#define PM_CROSS_10_NUM 7
+#define PM_CROSS_15_NUM 9*2
+#define PM_CROSS_20_NUM 11*2
+#define PM_CROSS_25_NUM 13*2
+#define PM_CROSS_30_NUM 15*2
+#define PM_CROSS_35_NUM 17*3
+#define PM_CROSS_40_NUM 19*3
+#define PM_CROSS_45_NUM 21*3
+#define PM_CROSS_50_NUM 23*3
+#define PM_CROSS_55_NUM 25*4
+#define PM_CROSS_60_NUM 27*4
+#define PM_CROSS_65_NUM 32*4
+#define PM_CROSS_70_NUM 32*4
-/*----------------------------------------------------------------------*/
+#define PM_PLUS_10_OFT 0
+#define PM_PLUS_15_OFT PM_PLUS_10_OFT + PM_PLUS_10_NUM
+#define PM_PLUS_20_OFT PM_PLUS_15_OFT + PM_PLUS_15_NUM
+#define PM_PLUS_25_OFT PM_PLUS_20_OFT + PM_PLUS_20_NUM
+#define PM_PLUS_30_OFT PM_PLUS_25_OFT + PM_PLUS_25_NUM
+#define PM_PLUS_35_OFT PM_PLUS_30_OFT + PM_PLUS_30_NUM
+#define PM_PLUS_40_OFT PM_PLUS_35_OFT + PM_PLUS_35_NUM
+#define PM_PLUS_45_OFT PM_PLUS_40_OFT + PM_PLUS_40_NUM
+#define PM_PLUS_50_OFT PM_PLUS_45_OFT + PM_PLUS_45_NUM
+#define PM_PLUS_55_OFT PM_PLUS_50_OFT + PM_PLUS_50_NUM
+#define PM_PLUS_60_OFT PM_PLUS_55_OFT + PM_PLUS_55_NUM
+#define PM_PLUS_65_OFT PM_PLUS_60_OFT + PM_PLUS_60_NUM
+#define PM_PLUS_70_OFT PM_PLUS_65_OFT + PM_PLUS_65_NUM
-void OpenGl_AspectMarker::SetContext (const CALL_DEF_CONTEXTMARKER &AContext)
+#define PM_STAR_10_OFT PM_PLUS_70_OFT + PM_PLUS_70_NUM
+#define PM_STAR_15_OFT PM_STAR_10_OFT + PM_STAR_10_NUM
+#define PM_STAR_20_OFT PM_STAR_15_OFT + PM_STAR_15_NUM
+#define PM_STAR_25_OFT PM_STAR_20_OFT + PM_STAR_20_NUM
+#define PM_STAR_30_OFT PM_STAR_25_OFT + PM_STAR_25_NUM
+#define PM_STAR_35_OFT PM_STAR_30_OFT + PM_STAR_30_NUM
+#define PM_STAR_40_OFT PM_STAR_35_OFT + PM_STAR_35_NUM
+#define PM_STAR_45_OFT PM_STAR_40_OFT + PM_STAR_40_NUM
+#define PM_STAR_50_OFT PM_STAR_45_OFT + PM_STAR_45_NUM
+#define PM_STAR_55_OFT PM_STAR_50_OFT + PM_STAR_50_NUM
+#define PM_STAR_60_OFT PM_STAR_55_OFT + PM_STAR_55_NUM
+#define PM_STAR_65_OFT PM_STAR_60_OFT + PM_STAR_60_NUM
+#define PM_STAR_70_OFT PM_STAR_65_OFT + PM_STAR_65_NUM
+
+#define PM_CIRC_10_OFT PM_STAR_70_OFT + PM_STAR_70_NUM
+#define PM_CIRC_15_OFT PM_CIRC_10_OFT + PM_CIRC_10_NUM
+#define PM_CIRC_20_OFT PM_CIRC_15_OFT + PM_CIRC_15_NUM
+#define PM_CIRC_25_OFT PM_CIRC_20_OFT + PM_CIRC_20_NUM
+#define PM_CIRC_30_OFT PM_CIRC_25_OFT + PM_CIRC_25_NUM
+#define PM_CIRC_35_OFT PM_CIRC_30_OFT + PM_CIRC_30_NUM
+#define PM_CIRC_40_OFT PM_CIRC_35_OFT + PM_CIRC_35_NUM
+#define PM_CIRC_45_OFT PM_CIRC_40_OFT + PM_CIRC_40_NUM
+#define PM_CIRC_50_OFT PM_CIRC_45_OFT + PM_CIRC_45_NUM
+#define PM_CIRC_55_OFT PM_CIRC_50_OFT + PM_CIRC_50_NUM
+#define PM_CIRC_60_OFT PM_CIRC_55_OFT + PM_CIRC_55_NUM
+#define PM_CIRC_65_OFT PM_CIRC_60_OFT + PM_CIRC_60_NUM
+#define PM_CIRC_70_OFT PM_CIRC_65_OFT + PM_CIRC_65_NUM
+
+#define PM_CROSS_10_OFT PM_CIRC_70_OFT + PM_CIRC_70_NUM
+#define PM_CROSS_15_OFT PM_CROSS_10_OFT + PM_CROSS_10_NUM
+#define PM_CROSS_20_OFT PM_CROSS_15_OFT + PM_CROSS_15_NUM
+#define PM_CROSS_25_OFT PM_CROSS_20_OFT + PM_CROSS_20_NUM
+#define PM_CROSS_30_OFT PM_CROSS_25_OFT + PM_CROSS_25_NUM
+#define PM_CROSS_35_OFT PM_CROSS_30_OFT + PM_CROSS_30_NUM
+#define PM_CROSS_40_OFT PM_CROSS_35_OFT + PM_CROSS_35_NUM
+#define PM_CROSS_45_OFT PM_CROSS_40_OFT + PM_CROSS_40_NUM
+#define PM_CROSS_50_OFT PM_CROSS_45_OFT + PM_CROSS_45_NUM
+#define PM_CROSS_55_OFT PM_CROSS_50_OFT + PM_CROSS_50_NUM
+#define PM_CROSS_60_OFT PM_CROSS_55_OFT + PM_CROSS_55_NUM
+#define PM_CROSS_65_OFT PM_CROSS_60_OFT + PM_CROSS_60_NUM
+#define PM_CROSS_70_OFT PM_CROSS_65_OFT + PM_CROSS_65_NUM
+
+static const PM_FONT_INFO arrPMFontInfo[][TEL_NO_OF_SIZES] =
{
- myColor.rgb[0] = (float) AContext.Color.r;
- myColor.rgb[1] = (float) AContext.Color.g;
- myColor.rgb[2] = (float) AContext.Color.b;
- myColor.rgb[3] = 1.0f;
- myType = (Aspect_TypeOfMarker) AContext.MarkerType;
- myScale = (float) AContext.Scale;
+ // TOM_POINT - not used
+ {{0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0}},
+
+ // TOM_PLUS
+ {{ 9.f, 9.f, PM_PLUS_10_OFT},
+ {11.f, 11.f, PM_PLUS_15_OFT},
+ {13.f, 13.f, PM_PLUS_20_OFT},
+ {15.f, 15.f, PM_PLUS_25_OFT},
+ {17.f, 17.f, PM_PLUS_30_OFT},
+ {19.f, 19.f, PM_PLUS_35_OFT},
+ {21.f, 21.f, PM_PLUS_40_OFT},
+ {23.f, 23.f, PM_PLUS_45_OFT},
+ {25.f, 25.f, PM_PLUS_50_OFT},
+ {27.f, 27.f, PM_PLUS_55_OFT},
+ {29.f, 29.f, PM_PLUS_60_OFT},
+ {31.f, 31.f, PM_PLUS_65_OFT},
+ {32.f, 32.f, PM_PLUS_70_OFT}},
+
+ // TOM_STAR
+ {{ 7.f, 9.f, PM_STAR_10_OFT},
+ {9.f, 11.f, PM_STAR_15_OFT},
+ {11.f, 13.f, PM_STAR_20_OFT},
+ {13.f, 15.f, PM_STAR_25_OFT},
+ {13.f, 17.f, PM_STAR_30_OFT},
+ {15.f, 19.f, PM_STAR_35_OFT},
+ {17.f, 21.f, PM_STAR_40_OFT},
+ {19.f, 23.f, PM_STAR_45_OFT},
+ {21.f, 25.f, PM_STAR_50_OFT},
+ {23.f, 27.f, PM_STAR_55_OFT},
+ {25.f, 29.f, PM_STAR_60_OFT},
+ {32.f, 32.f, PM_STAR_65_OFT},
+ {32.f, 32.f, PM_STAR_70_OFT}},
+
+ // TOM_X
+ {{ 7.f, 7.f, PM_CROSS_10_OFT},
+ { 9.f, 9.f, PM_CROSS_15_OFT},
+ {11.f, 11.f, PM_CROSS_20_OFT},
+ {13.f, 13.f, PM_CROSS_25_OFT},
+ {15.f, 15.f, PM_CROSS_30_OFT},
+ {17.f, 17.f, PM_CROSS_35_OFT},
+ {19.f, 19.f, PM_CROSS_40_OFT},
+ {21.f, 21.f, PM_CROSS_45_OFT},
+ {23.f, 23.f, PM_CROSS_50_OFT},
+ {25.f, 25.f, PM_CROSS_55_OFT},
+ {27.f, 27.f, PM_CROSS_60_OFT},
+ {32.f, 32.f, PM_CROSS_65_OFT},
+ {32.f, 32.f, PM_CROSS_70_OFT}},
+
+ // TOM_O
+ {{ 7.f, 7.f, PM_CIRC_10_OFT},
+ { 9.f, 9.f, PM_CIRC_15_OFT},
+ { 9.f, 9.f, PM_CIRC_20_OFT},
+ {11.f, 11.f, PM_CIRC_25_OFT},
+ {13.f, 13.f, PM_CIRC_30_OFT},
+ {15.f, 15.f, PM_CIRC_35_OFT},
+ {17.f, 17.f, PM_CIRC_40_OFT},
+ {19.f, 19.f, PM_CIRC_45_OFT},
+ {21.f, 21.f, PM_CIRC_50_OFT},
+ {23.f, 23.f, PM_CIRC_55_OFT},
+ {25.f, 25.f, PM_CIRC_60_OFT},
+ {27.f, 27.f, PM_CIRC_65_OFT},
+ {29.f, 29.f, PM_CIRC_70_OFT}}
+};
+
+static const Standard_Byte OpenGl_AspectMarker_myMarkerRaster[] =
+{
+ // TYPE = PLUS
+
+ 0x08,0x00,
+ 0x08,0x00,
+ 0x08,0x00,
+ 0x08,0x00,
+ 0xff,0x80,
+ 0x08,0x00,
+ 0x08,0x00,
+ 0x08,0x00,
+ 0x08,0x00, // PLUS 9x9 = 1.0
+
+ 0x04,0x00,
+ 0x04,0x00,
+ 0x04,0x00,
+ 0x04,0x00,
+ 0x04,0x00,
+ 0xff,0xe0,
+ 0x04,0x00,
+ 0x04,0x00,
+ 0x04,0x00,
+ 0x04,0x00,
+ 0x04,0x00, // PLUS 11x11 = 1.5
+
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0xff,0xf8,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00, // PLUS 13x13 = 2.0
+
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0xff,0xfe,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00, // PLUS 15x15 = 2.5
+
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0xff,0xff, 0x80,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00, // PLUS 17x17 = 3.0
+
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0xff,0xff, 0xe0,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00, // PLUS 19x19 = 3.5
+
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0xff,0xff, 0xf8,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00, // PLUS 21x21 = 4.0
+
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0xff,0xff, 0xfe,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00, // PLUS 23x23 = 4.5
+
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0xff,0xff, 0xff,0x80,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00, // PLUS 25x25 = 5.0
+
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0xff,0xff, 0xff,0xe0,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00, // PLUS 27x27 = 5.5
+
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0xff,0xff, 0xff,0xf8,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00,
+ 0x00,0x02, 0x00,0x00, // PLUS 29x29 = 6.0
+
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0xff,0xff, 0xff,0xfd,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00,
+ 0x00,0x01, 0x00,0x00, // PLUS 31x31 = 6.5
+
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0xff,0xff, 0xff,0xff,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00, // PLUS 32x32 = 7.0
+
+ // TYPE = STAR
+
+ 0x10,
+ 0x10,
+ 0xd6,
+ 0x38,
+ 0x10,
+ 0x38,
+ 0xd6,
+ 0x10,
+ 0x10, // STAR 7x9 = 1.0
+
+ 0x08,0x00,
+ 0x08,0x00,
+ 0x08,0x00,
+ 0xc9,0x80,
+ 0x3e,0x00,
+ 0x08,0x00,
+ 0x3e,0x00,
+ 0xc9,0x80,
+ 0x08,0x00,
+ 0x08,0x00,
+ 0x08,0x00, // STAR 9x11 = 1.5
+
+ 0x04,0x00,
+ 0x04,0x00,
+ 0x04,0x00,
+ 0x84,0x20,
+ 0x64,0xc0,
+ 0x1f,0x00,
+ 0x04,0x00,
+ 0x1f,0x00,
+ 0x64,0xc0,
+ 0x84,0x20,
+ 0x04,0x00,
+ 0x04,0x00,
+ 0x04,0x00, // STAR 11x13 = 2.0
+
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x82,0x18,
+ 0x62,0x60,
+ 0x1b,0x80,
+ 0x06,0x00,
+ 0x1b,0x80,
+ 0x62,0x60,
+ 0x82,0x18,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00, // STAR 13x15 = 2.5
+
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x82,0x08,
+ 0x62,0x30,
+ 0x12,0x40,
+ 0x0f,0x80,
+ 0x02,0x00,
+ 0x0f,0x80,
+ 0x12,0x40,
+ 0x62,0x30,
+ 0x82,0x08,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00,
+ 0x02,0x00, // STAR 13x17 = 3.0
+
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0xc1,0x06,
+ 0x21,0x18,
+ 0x19,0x20,
+ 0x07,0xc0,
+ 0x01,0x00,
+ 0x07,0xc0,
+ 0x19,0x20,
+ 0x21,0x18,
+ 0xc1,0x06,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00,
+ 0x01,0x00, // STAR 15x19 = 3.5
+
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x80,0x80, 0x80,
+ 0x60,0x83, 0x00,
+ 0x10,0x8c, 0x00,
+ 0x0c,0x90, 0x00,
+ 0x03,0xe0, 0x00,
+ 0x00,0x80, 0x00,
+ 0x03,0xe0, 0x00,
+ 0x0c,0x90, 0x00,
+ 0x10,0x8c, 0x00,
+ 0x60,0x83, 0x00,
+ 0x80,0x80, 0x80,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00,
+ 0x00,0x80, 0x00, // STAR 17x21 = 4.0
+
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0xc0,0x40, 0x60,
+ 0x30,0x41, 0x80,
+ 0x08,0x42, 0x00,
+ 0x06,0x4c, 0x00,
+ 0x01,0xf0, 0x00,
+ 0x00,0x40, 0x00,
+ 0x01,0xf0, 0x00,
+ 0x06,0x4c, 0x00,
+ 0x08,0x42, 0x00,
+ 0x30,0x41, 0x80,
+ 0xc0,0x40, 0x60,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0x40, 0x00, // STAR 19x23 = 4.5
+
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x80,0x20, 0x08,
+ 0x60,0x20, 0x30,
+ 0x18,0x20, 0xc0,
+ 0x04,0x21, 0x00,
+ 0x03,0x26, 0x00,
+ 0x00,0xf8, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0xf8, 0x00,
+ 0x03,0x26, 0x00,
+ 0x04,0x21, 0x00,
+ 0x18,0x20, 0xc0,
+ 0x60,0x20, 0x30,
+ 0x80,0x20, 0x08,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x20, 0x00, // STAR 21x25 = 5.0
+
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0xc0,0x10, 0x06,
+ 0x30,0x10, 0x18,
+ 0x08,0x10, 0x60,
+ 0x06,0x10, 0x80,
+ 0x01,0x93, 0x00,
+ 0x00,0x7c, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x7c, 0x00,
+ 0x01,0x93, 0x00,
+ 0x06,0x10, 0x80,
+ 0x08,0x10, 0x60,
+ 0x30,0x10, 0x18,
+ 0xc0,0x10, 0x06,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x10, 0x00, // STAR 23x27 = 5.5
+
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x80,0x08, 0x00,0x80,
+ 0x60,0x08, 0x03,0x00,
+ 0x18,0x08, 0x0c,0x00,
+ 0x04,0x08, 0x30,0x00,
+ 0x03,0x08, 0x40,0x00,
+ 0x00,0xc9, 0x80,0x00,
+ 0x00,0x3e, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x3e, 0x00,0x00,
+ 0x00,0xc9, 0x80,0x00,
+ 0x03,0x08, 0x40,0x00,
+ 0x04,0x08, 0x30,0x00,
+ 0x18,0x08, 0x0c,0x00,
+ 0x60,0x08, 0x03,0x00,
+ 0x80,0x08, 0x00,0x80,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00, // STAR 25x29 = 6.0
+
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x30,0x00, 0x80,0x06,
+ 0x0c,0x00, 0x80,0x18,
+ 0x03,0x00, 0x80,0x60,
+ 0x00,0xc0, 0x81,0x80,
+ 0x00,0x30, 0x86,0x00,
+ 0x00,0x0c, 0x98,0x00,
+ 0x00,0x03, 0xe0,0x00,
+ 0x00,0x03, 0xe0,0x00,
+ 0x00,0x0c, 0x98,0x00,
+ 0x00,0x30, 0x86,0x00,
+ 0x00,0xc0, 0x81,0x80,
+ 0x03,0x00, 0x80,0x60,
+ 0x0c,0x00, 0x80,0x18,
+ 0x30,0x00, 0x80,0x06,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x80,0x00,
+ 0x00,0x00, 0x00,0x00,
+ 0x00,0x00, 0x00,0x00, // STAR 32x32 = 6.5
+
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x10, 0x00, 0x80, 0x04,
+ 0x0c, 0x00, 0x80, 0x18,
+ 0x02, 0x00, 0x80, 0x20,
+ 0x01, 0x80, 0x80, 0xc0,
+ 0x00, 0x40, 0x81, 0x00,
+ 0x00, 0x30, 0x86, 0x00,
+ 0x00, 0x08, 0x88, 0x00,
+ 0x00, 0x06, 0xb0, 0x00,
+ 0x00, 0x01, 0xc0, 0x00,
+ 0x00, 0x06, 0xb0, 0x00,
+ 0x00, 0x08, 0x88, 0x00,
+ 0x00, 0x30, 0x86, 0x00,
+ 0x00, 0x40, 0x81, 0x00,
+ 0x01, 0x80, 0x80, 0xc0,
+ 0x02, 0x00, 0x80, 0x20,
+ 0x0c, 0x00, 0x80, 0x18,
+ 0x10, 0x00, 0x80, 0x04,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00, // STAR 32x32 = 7.0
+
+ // TYPE = CIRC
+
+ 0x38,
+ 0x44,
+ 0x82,
+ 0x82,
+ 0x82,
+ 0x44,
+ 0x38, // CIRC 7x7 = 1.0
+
+ 0x3c,0x00,
+ 0x42,0x00,
+ 0x81,0x00,
+ 0x81,0x00,
+ 0x81,0x00,
+ 0x81,0x00,
+ 0x42,0x00,
+ 0x3c,0x00,
+ 0x00,0x00, //CIRC 9x9 = 1.5
+
+ 0x3e,0x00,
+ 0x41,0x00,
+ 0x81,0x80,
+ 0x80,0x80,
+ 0x80,0x80,
+ 0x80,0x80,
+ 0x81,0x80,
+ 0x41,0x00,
+ 0x3e,0x00, // CIRC 9x9 = 2.0
+
+ 0x1f,0x00,
+ 0x20,0x80,
+ 0x40,0x40,
+ 0x80,0x20,
+ 0x80,0x20,
+ 0x80,0x20,
+ 0x80,0x20,
+ 0x80,0x20,
+ 0x40,0x40,
+ 0x20,0x80,
+ 0x1f,0x00, // CIRC 11x11 = 2.5
+
+ 0x0f,0x80,
+ 0x10,0x40,
+ 0x20,0x20,
+ 0x40,0x10,
+ 0x80,0x08,
+ 0x80,0x08,
+ 0x80,0x08,
+ 0x80,0x08,
+ 0x80,0x08,
+ 0x40,0x10,
+ 0x20,0x20,
+ 0x10,0x40,
+ 0x0f,0x80, // CIRC 13x13 = 3.0
+
+ 0x07,0xc0,
+ 0x18,0x30,
+ 0x20,0x08,
+ 0x40,0x04,
+ 0x40,0x04,
+ 0x80,0x02,
+ 0x80,0x02,
+ 0x80,0x02,
+ 0x80,0x02,
+ 0x80,0x02,
+ 0x40,0x04,
+ 0x40,0x04,
+ 0x20,0x08,
+ 0x18,0x30,
+ 0x07,0xc0, // CIRC 15x15 = 3.5
+
+ 0x03,0xe0, 0x00,
+ 0x0c,0x18, 0x00,
+ 0x10,0x04, 0x00,
+ 0x20,0x02, 0x00,
+ 0x40,0x01, 0x00,
+ 0x40,0x01, 0x00,
+ 0x80,0x00, 0x80,
+ 0x80,0x00, 0x80,
+ 0x80,0x00, 0x80,
+ 0x80,0x00, 0x80,
+ 0x80,0x00, 0x80,
+ 0x40,0x01, 0x00,
+ 0x40,0x01, 0x00,
+ 0x20,0x02, 0x00,
+ 0x10,0x04, 0x00,
+ 0x0c,0x18, 0x00,
+ 0x03,0xe0, 0x00, // CIRC 17x17 = 4.0
+
+ 0x03,0xf8, 0x00,
+ 0x0e,0x0e, 0x00,
+ 0x18,0x03, 0x00,
+ 0x20,0x00, 0x80,
+ 0x60,0x00, 0xc0,
+ 0x40,0x00, 0x40,
+ 0xc0,0x00, 0x60,
+ 0x80,0x00, 0x20,
+ 0x80,0x00, 0x20,
+ 0x80,0x00, 0x20,
+ 0x80,0x00, 0x20,
+ 0x80,0x00, 0x20,
+ 0xc0,0x00, 0x60,
+ 0x40,0x00, 0x40,
+ 0x60,0x00, 0xc0,
+ 0x20,0x00, 0x80,
+ 0x18,0x03, 0x00,
+ 0x0e,0x0e, 0x00,
+ 0x03,0xf8, 0x00, // CIRC 19x19 = 4.5
+
+ 0x01,0xfc, 0x00,
+ 0x06,0x03, 0x00,
+ 0x08,0x00, 0x80,
+ 0x10,0x00, 0x40,
+ 0x20,0x00, 0x20,
+ 0x40,0x00, 0x10,
+ 0x40,0x00, 0x10,
+ 0x80,0x00, 0x08,
+ 0x80,0x00, 0x08,
+ 0x80,0x00, 0x08,
+ 0x80,0x00, 0x08,
+ 0x80,0x00, 0x08,
+ 0x80,0x00, 0x08,
+ 0x80,0x00, 0x08,
+ 0x40,0x00, 0x10,
+ 0x40,0x00, 0x10,
+ 0x20,0x00, 0x20,
+ 0x10,0x00, 0x40,
+ 0x08,0x00, 0x80,
+ 0x06,0x03, 0x00,
+ 0x01,0xfc, 0x00, // CIRC 21x21 = 5.0
+
+ 0x00,0xfe, 0x00,
+ 0x03,0x01, 0x80,
+ 0x0c,0x00, 0x60,
+ 0x18,0x00, 0x30,
+ 0x30,0x00, 0x18,
+ 0x20,0x00, 0x08,
+ 0x40,0x00, 0x04,
+ 0x40,0x00, 0x04,
+ 0x80,0x00, 0x02,
+ 0x80,0x00, 0x02,
+ 0x80,0x00, 0x02,
+ 0x80,0x00, 0x02,
+ 0x80,0x00, 0x02,
+ 0x80,0x00, 0x02,
+ 0x80,0x00, 0x02,
+ 0x40,0x00, 0x04,
+ 0x40,0x00, 0x04,
+ 0x20,0x00, 0x08,
+ 0x30,0x00, 0x18,
+ 0x18,0x00, 0x30,
+ 0x0c,0x00, 0x60,
+ 0x03,0x01, 0x80,
+ 0x00,0xfe, 0x00, // CIRC 23x23 = 5.5
+
+ 0x00,0x7f, 0x00,0x00,
+ 0x01,0x80, 0xc0,0x00,
+ 0x06,0x00, 0x30,0x00,
+ 0x08,0x00, 0x08,0x00,
+ 0x10,0x00, 0x04,0x00,
+ 0x20,0x00, 0x02,0x00,
+ 0x20,0x00, 0x02,0x00,
+ 0x40,0x00, 0x01,0x00,
+ 0x40,0x00, 0x01,0x00,
+ 0x80,0x00, 0x00,0x80,
+ 0x80,0x00, 0x00,0x80,
+ 0x80,0x00, 0x00,0x80,
+ 0x80,0x00, 0x00,0x80,
+ 0x80,0x00, 0x00,0x80,
+ 0x80,0x00, 0x00,0x80,
+ 0x80,0x00, 0x00,0x80,
+ 0x40,0x00, 0x01,0x00,
+ 0x40,0x00, 0x01,0x00,
+ 0x20,0x00, 0x02,0x00,
+ 0x20,0x00, 0x02,0x00,
+ 0x10,0x00, 0x04,0x00,
+ 0x08,0x00, 0x08,0x00,
+ 0x06,0x00, 0x30,0x00,
+ 0x01,0x80, 0xc0,0x00,
+ 0x00,0x7f, 0x00,0x00, // CIRC 25x25 = 6.0
+
+ 0x00,0x3f, 0x80,0x00,
+ 0x01,0xc0, 0x70,0x00,
+ 0x03,0x00, 0x18,0x00,
+ 0x0c,0x00, 0x06,0x00,
+ 0x18,0x00, 0x03,0x00,
+ 0x10,0x00, 0x01,0x00,
+ 0x20,0x00, 0x00,0x80,
+ 0x60,0x00, 0x00,0xc0,
+ 0x40,0x00, 0x00,0x40,
+ 0x40,0x00, 0x00,0x40,
+ 0x80,0x00, 0x00,0x20,
+ 0x80,0x00, 0x00,0x20,
+ 0x80,0x00, 0x00,0x20,
+ 0x80,0x00, 0x00,0x20,
+ 0x80,0x00, 0x00,0x20,
+ 0x80,0x00, 0x00,0x20,
+ 0x80,0x00, 0x00,0x20,
+ 0x40,0x00, 0x00,0x40,
+ 0x40,0x00, 0x00,0x40,
+ 0x60,0x00, 0x00,0xc0,
+ 0x20,0x00, 0x00,0x80,
+ 0x10,0x00, 0x01,0x00,
+ 0x18,0x00, 0x03,0x00,
+ 0x0c,0x00, 0x06,0x00,
+ 0x03,0x00, 0x18,0x00,
+ 0x01,0xc0, 0x70,0x00,
+ 0x00,0x3f, 0x80,0x00, // CIRC 27x27 = 6.5
+
+ 0x00,0x1f, 0xc0,0x00,
+ 0x00,0xe0, 0x38,0x00,
+ 0x01,0x00, 0x04,0x00,
+ 0x06,0x00, 0x03,0x00,
+ 0x08,0x00, 0x00,0x80,
+ 0x10,0x00, 0x00,0x40,
+ 0x10,0x00, 0x00,0x40,
+ 0x20,0x00, 0x00,0x20,
+ 0x40,0x00, 0x00,0x10,
+ 0x40,0x00, 0x00,0x10,
+ 0x40,0x00, 0x00,0x10,
+ 0x80,0x00, 0x00,0x08,
+ 0x80,0x00, 0x00,0x08,
+ 0x80,0x00, 0x00,0x08,
+ 0x80,0x00, 0x00,0x08,
+ 0x80,0x00, 0x00,0x08,
+ 0x80,0x00, 0x00,0x08,
+ 0x80,0x00, 0x00,0x08,
+ 0x40,0x00, 0x00,0x10,
+ 0x40,0x00, 0x00,0x10,
+ 0x40,0x00, 0x00,0x10,
+ 0x20,0x00, 0x00,0x20,
+ 0x10,0x00, 0x00,0x40,
+ 0x10,0x00, 0x00,0x40,
+ 0x08,0x00, 0x00,0x80,
+ 0x06,0x00, 0x03,0x00,
+ 0x01,0x00, 0x04,0x00,
+ 0x00,0xe0, 0x38,0x00,
+ 0x00,0x1f, 0xc0,0x00, // CIRC 29x29 = 7.0
+
+ // TYPE = CROSS
+
+ 0x82,
+ 0x44,
+ 0x28,
+ 0x10,
+ 0x28,
+ 0x44,
+ 0x82, // CROSS 7x7 = 1.0
+
+ 0x80,0x80,
+ 0x41,0x00,
+ 0x22,0x00,
+ 0x14,0x00,
+ 0x08,0x00,
+ 0x14,0x00,
+ 0x22,0x00,
+ 0x41,0x00,
+ 0x80,0x80, // CROSS 9x9 = 1.5
+
+ 0x80,0x20,
+ 0x40,0x40,
+ 0x20,0x80,
+ 0x11,0x00,
+ 0x0a,0x00,
+ 0x04,0x00,
+ 0x0a,0x00,
+ 0x11,0x00,
+ 0x20,0x80,
+ 0x40,0x40,
+ 0x80,0x20, // CROSS 11x11 = 2.0
+
+ 0x80,0x08,
+ 0x40,0x10,
+ 0x20,0x20,
+ 0x10,0x40,
+ 0x08,0x80,
+ 0x05,0x00,
+ 0x02,0x00,
+ 0x05,0x00,
+ 0x08,0x80,
+ 0x10,0x40,
+ 0x20,0x20,
+ 0x40,0x10,
+ 0x80,0x08, // CROSS 13x13 = 2.5
+
+ 0x80,0x02,
+ 0x40,0x04,
+ 0x20,0x08,
+ 0x10,0x10,
+ 0x08,0x20,
+ 0x04,0x40,
+ 0x02,0x80,
+ 0x01,0x00,
+ 0x02,0x80,
+ 0x04,0x40,
+ 0x08,0x20,
+ 0x10,0x10,
+ 0x20,0x08,
+ 0x40,0x04,
+ 0x80,0x02, // CROSS 15x15 = 3.0
+
+ 0x80,0x00, 0x80,
+ 0x40,0x01, 0x00,
+ 0x20,0x02, 0x00,
+ 0x10,0x04, 0x00,
+ 0x08,0x08, 0x00,
+ 0x04,0x10, 0x00,
+ 0x02,0x20, 0x00,
+ 0x01,0x40, 0x00,
+ 0x00,0x80, 0x00,
+ 0x01,0x40, 0x00,
+ 0x02,0x20, 0x00,
+ 0x04,0x10, 0x00,
+ 0x08,0x08, 0x00,
+ 0x10,0x04, 0x00,
+ 0x20,0x02, 0x00,
+ 0x40,0x01, 0x00,
+ 0x80,0x00, 0x80, // CROSS 17x17 = 3.5
+
+ 0x80,0x00, 0x20,
+ 0x40,0x00, 0x40,
+ 0x20,0x00, 0x80,
+ 0x10,0x01, 0x00,
+ 0x08,0x02, 0x00,
+ 0x04,0x04, 0x00,
+ 0x02,0x08, 0x00,
+ 0x01,0x10, 0x00,
+ 0x00,0xa0, 0x00,
+ 0x00,0x40, 0x00,
+ 0x00,0xa0, 0x00,
+ 0x01,0x10, 0x00,
+ 0x02,0x08, 0x00,
+ 0x04,0x04, 0x00,
+ 0x08,0x02, 0x00,
+ 0x10,0x01, 0x00,
+ 0x20,0x00, 0x80,
+ 0x40,0x00, 0x40,
+ 0x80,0x00, 0x20, // CROSS 19x19 = 4.0
+
+ 0x80,0x00, 0x08,
+ 0x40,0x00, 0x10,
+ 0x20,0x00, 0x20,
+ 0x10,0x00, 0x40,
+ 0x08,0x00, 0x80,
+ 0x04,0x01, 0x00,
+ 0x02,0x02, 0x00,
+ 0x01,0x04, 0x00,
+ 0x00,0x88, 0x00,
+ 0x00,0x50, 0x00,
+ 0x00,0x20, 0x00,
+ 0x00,0x50, 0x00,
+ 0x00,0x88, 0x00,
+ 0x01,0x04, 0x00,
+ 0x02,0x02, 0x00,
+ 0x04,0x01, 0x00,
+ 0x08,0x00, 0x80,
+ 0x10,0x00, 0x40,
+ 0x20,0x00, 0x20,
+ 0x40,0x00, 0x10,
+ 0x80,0x00, 0x08,/* CROSS 21x21 = 4.5 */
+
+ 0x80,0x00, 0x02,
+ 0x40,0x00, 0x04,
+ 0x20,0x00, 0x08,
+ 0x10,0x00, 0x10,
+ 0x08,0x00, 0x20,
+ 0x04,0x00, 0x40,
+ 0x02,0x00, 0x80,
+ 0x01,0x01, 0x00,
+ 0x00,0x82, 0x00,
+ 0x00,0x44, 0x00,
+ 0x00,0x28, 0x00,
+ 0x00,0x10, 0x00,
+ 0x00,0x28, 0x00,
+ 0x00,0x44, 0x00,
+ 0x00,0x82, 0x00,
+ 0x01,0x01, 0x00,
+ 0x02,0x00, 0x80,
+ 0x04,0x00, 0x40,
+ 0x08,0x00, 0x20,
+ 0x10,0x00, 0x10,
+ 0x20,0x00, 0x08,
+ 0x40,0x00, 0x04,
+ 0x80,0x00, 0x02, // CROSS 23x23 = 5.0
+
+ 0x80,0x00, 0x00,0x80,
+ 0x40,0x00, 0x01,0x00,
+ 0x20,0x00, 0x02,0x00,
+ 0x10,0x00, 0x04,0x00,
+ 0x08,0x00, 0x08,0x00,
+ 0x04,0x00, 0x10,0x00,
+ 0x02,0x00, 0x20,0x00,
+ 0x01,0x00, 0x40,0x00,
+ 0x00,0x80, 0x80,0x00,
+ 0x00,0x41, 0x00,0x00,
+ 0x00,0x22, 0x00,0x00,
+ 0x00,0x14, 0x00,0x00,
+ 0x00,0x08, 0x00,0x00,
+ 0x00,0x14, 0x00,0x00,
+ 0x00,0x22, 0x00,0x00,
+ 0x00,0x41, 0x00,0x00,
+ 0x00,0x80, 0x80,0x00,
+ 0x01,0x00, 0x40,0x00,
+ 0x02,0x00, 0x20,0x00,
+ 0x04,0x00, 0x10,0x00,
+ 0x08,0x00, 0x08,0x00,
+ 0x10,0x00, 0x04,0x00,
+ 0x20,0x00, 0x02,0x00,
+ 0x40,0x00, 0x01,0x00,
+ 0x80,0x00, 0x00,0x80, // CROSS 25x25 = 5.5
+
+ 0x80,0x00, 0x00,0x20,
+ 0x40,0x00, 0x00,0x40,
+ 0x20,0x00, 0x00,0x80,
+ 0x10,0x00, 0x01,0x00,
+ 0x08,0x00, 0x02,0x00,
+ 0x04,0x00, 0x04,0x00,
+ 0x02,0x00, 0x08,0x00,
+ 0x01,0x00, 0x10,0x00,
+ 0x00,0x80, 0x20,0x00,
+ 0x00,0x40, 0x40,0x00,
+ 0x00,0x20, 0x80,0x00,
+ 0x00,0x11, 0x00,0x00,
+ 0x00,0x0a, 0x00,0x00,
+ 0x00,0x04, 0x00,0x00,
+ 0x00,0x0a, 0x00,0x00,
+ 0x00,0x11, 0x00,0x00,
+ 0x00,0x20, 0x80,0x00,
+ 0x00,0x40, 0x40,0x00,
+ 0x00,0x80, 0x20,0x00,
+ 0x01,0x00, 0x10,0x00,
+ 0x02,0x00, 0x08,0x00,
+ 0x04,0x00, 0x04,0x00,
+ 0x08,0x00, 0x02,0x00,
+ 0x10,0x00, 0x01,0x00,
+ 0x20,0x00, 0x00,0x80,
+ 0x40,0x00, 0x00,0x40,
+ 0x80,0x00, 0x00,0x20, // CROSS 27x27 = 6.0
+
+ 0x00,0x00, 0x00,0x00,
+ 0x00,0x00, 0x00,0x00,
+ 0x20,0x00, 0x00,0x04,
+ 0x10,0x00, 0x00,0x08,
+ 0x08,0x00, 0x00,0x10,
+ 0x04,0x00, 0x00,0x20,
+ 0x02,0x00, 0x00,0x40,
+ 0x01,0x00, 0x00,0x80,
+ 0x00,0x80, 0x01,0x00,
+ 0x00,0x40, 0x02,0x00,
+ 0x00,0x20, 0x04,0x00,
+ 0x00,0x10, 0x08,0x00,
+ 0x00,0x08, 0x10,0x00,
+ 0x00,0x04, 0x20,0x00,
+ 0x00,0x02, 0x40,0x00,
+ 0x00,0x01, 0x80,0x00,
+ 0x00,0x01, 0x80,0x00,
+ 0x00,0x02, 0x40,0x00,
+ 0x00,0x04, 0x20,0x00,
+ 0x00,0x08, 0x10,0x00,
+ 0x00,0x10, 0x08,0x00,
+ 0x00,0x20, 0x04,0x00,
+ 0x00,0x40, 0x02,0x00,
+ 0x00,0x80, 0x01,0x00,
+ 0x01,0x00, 0x00,0x80,
+ 0x02,0x00, 0x00,0x40,
+ 0x04,0x00, 0x00,0x20,
+ 0x08,0x00, 0x00,0x10,
+ 0x10,0x00, 0x00,0x08,
+ 0x20,0x00, 0x00,0x04,
+ 0x00,0x00, 0x00,0x00,
+ 0x00,0x00, 0x00,0x00, // CROSS 32x32 = 6.5
+
+ 0x00,0x00, 0x00,0x00,
+ 0x40,0x00, 0x00,0x02,
+ 0x20,0x00, 0x00,0x04,
+ 0x10,0x00, 0x00,0x08,
+ 0x08,0x00, 0x00,0x10,
+ 0x04,0x00, 0x00,0x20,
+ 0x02,0x00, 0x00,0x40,
+ 0x01,0x00, 0x00,0x80,
+ 0x00,0x80, 0x01,0x00,
+ 0x00,0x40, 0x02,0x00,
+ 0x00,0x20, 0x04,0x00,
+ 0x00,0x10, 0x08,0x00,
+ 0x00,0x08, 0x10,0x00,
+ 0x00,0x04, 0x20,0x00,
+ 0x00,0x02, 0x40,0x00,
+ 0x00,0x01, 0x80,0x00,
+ 0x00,0x01, 0x80,0x00,
+ 0x00,0x02, 0x40,0x00,
+ 0x00,0x04, 0x20,0x00,
+ 0x00,0x08, 0x10,0x00,
+ 0x00,0x10, 0x08,0x00,
+ 0x00,0x20, 0x04,0x00,
+ 0x00,0x40, 0x02,0x00,
+ 0x00,0x80, 0x01,0x00,
+ 0x01,0x00, 0x00,0x80,
+ 0x02,0x00, 0x00,0x40,
+ 0x04,0x00, 0x00,0x20,
+ 0x08,0x00, 0x00,0x10,
+ 0x10,0x00, 0x00,0x08,
+ 0x20,0x00, 0x00,0x04,
+ 0x40,0x00, 0x00,0x02,
+ 0x00,0x00, 0x00,0x00 // CROSS 32x32 = 7.0
+};
+
+// =======================================================================
+// function : GetMarkerBitMapArray
+// purpose : Returns a parameters for the marker of the specified
+// type and scale.
+// =======================================================================
+void GetMarkerBitMapParam (const Aspect_TypeOfMarker theMarkerType,
+ const Standard_ShortReal& theScale,
+ Standard_Integer& theWidth,
+ Standard_Integer& theHeight,
+ Standard_Integer& theOffset,
+ Standard_Integer& theNumOfBytes)
+{
+ const Standard_Integer aType = (Standard_Integer )((theMarkerType > Aspect_TOM_O) ? Aspect_TOM_O : theMarkerType);
+ const Standard_Real anIndex = (Standard_Real )(TEL_NO_OF_SIZES - 1) * (theScale - (Standard_Real )TEL_PM_START_SIZE)
+ / (Standard_Real )(TEL_PM_END_SIZE - TEL_PM_START_SIZE);
+ Standard_Integer anId = (Standard_Integer )(anIndex + 0.5);
+ if (anId < 0)
+ {
+ anId = 0;
+ }
+ else if (anId >= TEL_NO_OF_SIZES)
+ {
+ anId = TEL_NO_OF_SIZES - 1;
+ }
+
+ theWidth = (Standard_Integer )arrPMFontInfo[aType][anId].width;
+ theHeight = (Standard_Integer )arrPMFontInfo[aType][anId].height;
+ theOffset = arrPMFontInfo[aType][anId].offset;
+ const Standard_Integer aNumOfBytesInRow = theWidth / 8 + (theWidth % 8 ? 1 : 0);
+ theNumOfBytes = theHeight * aNumOfBytesInRow;
+}
+
+// =======================================================================
+// function : GetTextureImage
+// purpose : Returns a marker image for the marker of the specified
+// type and scale.
+// =======================================================================
+Handle(Graphic3d_MarkerImage) GetTextureImage (const Aspect_TypeOfMarker theMarkerType,
+ const Standard_ShortReal& theScale)
+{
+ Standard_Integer aWidth, aHeight, anOffset, aNumOfBytes;
+ GetMarkerBitMapParam (theMarkerType, theScale, aWidth, aHeight, anOffset, aNumOfBytes);
+
+ Handle(TColStd_HArray1OfByte) aBitMap = new TColStd_HArray1OfByte (0, aNumOfBytes - 1);
+ for (Standard_Integer anIter = 0; anIter < aNumOfBytes; anIter++)
+ {
+ aBitMap->ChangeValue (anIter) = OpenGl_AspectMarker_myMarkerRaster[anOffset + anIter];
+ }
+
+ Handle(Graphic3d_MarkerImage) aTexture = new Graphic3d_MarkerImage (aBitMap, aWidth, aHeight);
+ return aTexture;
}
-/*----------------------------------------------------------------------*/
+// =======================================================================
+// function : MergeImages
+// purpose : Merge two image pixmap into one. Used for creating image for
+// following markers: Aspect_TOM_O_POINT, Aspect_TOM_O_PLUS,
+// Aspect_TOM_O_STAR, Aspect_TOM_O_X, Aspect_TOM_RING1,
+// Aspect_TOM_RING2, Aspect_TOM_RING3
+// =======================================================================
+Handle(Image_PixMap) MergeImages (const Handle(Image_PixMap)& theImage1,
+ const Handle(Image_PixMap)& theImage2)
+{
+ if (theImage1.IsNull() && theImage2.IsNull())
+ {
+ return Handle(Image_PixMap)();
+ }
+
+ Handle(Image_PixMap) aResultImage = new Image_PixMap();
+
+ Standard_Integer aWidth1 (0), aHeight1 (0);
+ if (!theImage1.IsNull())
+ {
+ aWidth1 = (Standard_Integer )theImage1->Width();
+ aHeight1 = (Standard_Integer )theImage1->Height();
+ }
+
+ Standard_Integer aWidth2 (0), aHeight2 (0);
+ if (!theImage2.IsNull())
+ {
+ aWidth2 = (Standard_Integer )theImage2->Width();
+ aHeight2 = (Standard_Integer )theImage2->Height();
+ }
+
+ const Standard_Integer aMaxWidth = Max (aWidth1, aWidth2);
+ const Standard_Integer aMaxHeight = Max (aHeight1, aHeight2);
+ const Standard_Integer aSize = Max (aMaxWidth, aMaxHeight);
+
+ aResultImage->InitZero (Image_PixMap::ImgGray, aSize, aSize);
+
+ if (!theImage1.IsNull())
+ {
+ const Standard_Integer aXOffset1 = Abs (aWidth1 - aMaxWidth) / 2;
+ const Standard_Integer anYOffset1 = Abs (aHeight1 - aMaxHeight) / 2;
+ for (Standard_Integer anY = 0; anY < aHeight1; anY++)
+ {
+ Standard_Byte* anImageLine = theImage1->ChangeRow (anY);
+ Standard_Byte* aResultImageLine = aResultImage->ChangeRow (anYOffset1 + anY);
+ for (Standard_Integer aX = 0; aX < aWidth1; aX++)
+ {
+ aResultImageLine[aXOffset1 + aX] |= anImageLine[aX];
+ }
+ }
+ }
+
+ if (!theImage2.IsNull())
+ {
+ const Standard_Integer aXOffset2 = Abs (aWidth2 - aMaxWidth) / 2;
+ const Standard_Integer anYOffset2 = Abs (aHeight2 - aMaxHeight) / 2;
+ for (Standard_Integer anY = 0; anY < aHeight2; anY++)
+ {
+ Standard_Byte* anImageLine = theImage2->ChangeRow (anY);
+ Standard_Byte* aResultImageLine = aResultImage->ChangeRow (anYOffset2 + anY);
+ for (Standard_Integer aX = 0; aX < aWidth2; aX++)
+ {
+ aResultImageLine[aXOffset2 + aX] |= anImageLine[aX];
+ }
+ }
+ }
+
+ return aResultImage;
+}
+
+// =======================================================================
+// function : OpenGl_AspectMarker
+// purpose :
+// =======================================================================
+OpenGl_AspectMarker::OpenGl_AspectMarker()
+ : myColor (myDefaultColor),
+ myType (Aspect_TOM_PLUS),
+ myScale (1.0f),
+ myMarkerSize (1.0f),
+ mySpriteKey (""),
+ mySpriteAKey ("")
+{}
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+void OpenGl_AspectMarker::Init (const Handle(OpenGl_Context)& theCtx,
+ const CALL_DEF_CONTEXTMARKER& theAspect)
+{
+ myColor.rgb[0] = (float )theAspect.Color.r;
+ myColor.rgb[1] = (float )theAspect.Color.g;
+ myColor.rgb[2] = (float )theAspect.Color.b;
+ myColor.rgb[3] = 1.0f;
+ myType = theAspect.MarkerType;
+ myScale = myMarkerSize = theAspect.Scale;
+
+ // generate key for shared resource
+ TCollection_AsciiString aNewKey, aNewKeyA;
+ if (myType == Aspect_TOM_USERDEFINED)
+ {
+ if (!theAspect.MarkerImage.IsNull())
+ {
+ aNewKey = theAspect.MarkerImage->GetImageId();
+ aNewKeyA = theAspect.MarkerImage->GetImageAlphaId();
+ }
+ }
+ else if (myType != Aspect_TOM_POINT)
+ {
+ // pre-defined markers
+ const Standard_Integer aScale = Standard_Integer(myScale + 0.5f);
+ aNewKey = TCollection_AsciiString ("OpenGl_AspectMarker") + myType + "_" + aScale;
+ aNewKeyA = aNewKey + "A";
+ if (myType == Aspect_TOM_BALL)
+ {
+ unsigned int aColor[3] =
+ {
+ (unsigned int )(255.0f * myColor.rgb[0]),
+ (unsigned int )(255.0f * myColor.rgb[1]),
+ (unsigned int )(255.0f * myColor.rgb[2])
+ };
+ char aBytes[8];
+ sprintf (aBytes, "%02X%02X%02X", aColor[0], aColor[1], aColor[2]);
+ aNewKey += aBytes;
+ }
+ }
+
+ // release old shared resources
+ const Standard_Boolean aNewResource = aNewKey.IsEmpty() || mySpriteKey != aNewKey;
+ if (aNewResource)
+ {
+ if (!mySprite.IsNull())
+ {
+ if (mySpriteKey.IsEmpty())
+ {
+ theCtx->DelayedRelease (mySprite);
+ mySprite.Nullify();
+ }
+ else
+ {
+ mySprite.Nullify(); // we need nullify all handles before ReleaseResource() call
+ theCtx->ReleaseResource (mySpriteKey);
+ }
+ }
+ mySpriteKey = aNewKey;
+ }
+ if (aNewKeyA.IsEmpty()
+ || mySpriteAKey != aNewKeyA)
+ {
+ if (!mySpriteA.IsNull())
+ {
+ if (mySpriteAKey.IsEmpty())
+ {
+ theCtx->DelayedRelease (mySpriteA);
+ mySpriteA.Nullify();
+ }
+ else
+ {
+ mySpriteA.Nullify(); // we need nullify all handles before ReleaseResource() call
+ theCtx->ReleaseResource (mySpriteKey);
+ }
+ }
+ mySpriteAKey = aNewKeyA;
+ }
+ if (myType == Aspect_TOM_POINT
+ || !aNewResource
+ || (myType == Aspect_TOM_USERDEFINED && theAspect.MarkerImage.IsNull()))
+ {
+ // nothing to do - just simple point
+ return;
+ }
+
+ if (!aNewKey.IsEmpty()
+ && theCtx->GetResource<Handle(OpenGl_PointSprite)> (aNewKey, mySprite)
+ && theCtx->GetResource<Handle(OpenGl_PointSprite)> (aNewKeyA, mySpriteA))
+ {
+ // reuse shared resource
+ if (!mySprite->IsDisplayList())
+ {
+ myMarkerSize = Standard_ShortReal (Max (mySprite->SizeX(), mySprite->SizeY()));
+ }
+ return;
+ }
+
+ mySprite = new OpenGl_PointSprite();
+ mySpriteA = new OpenGl_PointSprite();
+ if (!aNewKey.IsEmpty())
+ {
+ theCtx->ShareResource (aNewKey, mySprite);
+ theCtx->ShareResource (aNewKeyA, mySpriteA);
+ }
+
+ if (!theCtx.IsNull()
+ && theCtx->IsGlGreaterEqual (2, 0)
+ && !theCtx->caps->pntSpritesDisable)
+ {
+ // Creating texture resource for using it with point sprites
+ Handle(Graphic3d_MarkerImage) aNewMarkerImage;
+ Handle(Image_PixMap) anImage, anImageA;
+
+ if (myType == Aspect_TOM_USERDEFINED && !theAspect.MarkerImage.IsNull())
+ {
+ aNewMarkerImage = theAspect.MarkerImage;
+ anImage = aNewMarkerImage->GetImage();
+ }
+ else
+ {
+ // Creating image from default bitmap
+ Handle(TColStd_HArray1OfByte) aBitMap;
+ Handle(Graphic3d_MarkerImage) aMarkerImage1, aMarkerImage2;
+
+ const Standard_ShortReal aDelta = 0.1F;
+ Standard_ShortReal aScale = myScale;
+ Standard_ShortReal aLimit = 0.0F;
+
+ switch (myType)
+ {
+ case Aspect_TOM_O_POINT:
+ {
+ const Standard_Integer aSize = myScale > 7 ? 7 : (Standard_Integer )(myScale + 0.5F);
+ const Standard_Integer aNumOfBytes = (aSize / 8 + (aSize % 8 ? 1 : 0)) * aSize;
+ aBitMap = new TColStd_HArray1OfByte (0, aNumOfBytes - 1);
+ for (Standard_Integer anIter = 0; anIter < aBitMap->Length(); anIter++)
+ {
+ aBitMap->SetValue (anIter, 255);
+ }
+ aMarkerImage2 = new Graphic3d_MarkerImage (aBitMap, aSize, aSize);
+ }
+ case Aspect_TOM_O_PLUS:
+ case Aspect_TOM_O_STAR:
+ case Aspect_TOM_O_X:
+ {
+ // For this type of markers we merge two base bitmaps into one
+ // For example Aspect_TOM_O_PLUS = Aspect_TOM_O + Aspect_TOM_PLUS
+ aMarkerImage1 = GetTextureImage (Aspect_TOM_O, myScale);
+ if (myType != Aspect_TOM_O_POINT)
+ {
+ aMarkerImage2 = GetTextureImage (Aspect_TypeOfMarker (myType - Aspect_TOM_O_POINT), myScale);
+ }
+ anImage = MergeImages (aMarkerImage1->GetImage(), aMarkerImage2->GetImage());
+ aNewMarkerImage = new Graphic3d_MarkerImage (anImage);
+ break;
+ }
+ case Aspect_TOM_RING1:
+ if (aLimit == 0.0f) aLimit = aScale * 0.2f;
+ case Aspect_TOM_RING2:
+ if (aLimit == 0.0f) aLimit = aScale * 0.5f;
+ case Aspect_TOM_RING3:
+ {
+ if (aLimit == 0.0f) aLimit = aScale * 0.8f;
+ for (; aScale > aLimit && aScale >= 1.0f; aScale -= aDelta)
+ {
+ anImage = MergeImages (anImage, GetTextureImage (Aspect_TOM_O, aScale)->GetImage());
+ }
+ aNewMarkerImage = new Graphic3d_MarkerImage (anImage);
+ break;
+ }
+ case Aspect_TOM_BALL:
+ {
+ Standard_Integer aWidth, aHeight, anOffset, aNumOfBytes;
+ GetMarkerBitMapParam (Aspect_TOM_O, aScale, aWidth, aHeight, anOffset, aNumOfBytes);
+
+ const Standard_ShortReal aDelta = 0.1f;
+ NCollection_Vec4<Standard_Real> aColor (Standard_Real (myColor.rgb[0]),
+ Standard_Real (myColor.rgb[1]),
+ Standard_Real (myColor.rgb[2]),
+ Standard_Real (myColor.rgb[3]));
+
+ const Standard_Integer aSize = Max (aWidth + 2, aHeight + 2); // includes extra margin
+ anImage = new Image_PixMap();
+ anImageA = new Image_PixMap();
+ anImage ->InitZero (Image_PixMap::ImgBGRA, aSize, aSize);
+ anImageA->InitZero (Image_PixMap::ImgGray, aSize, aSize);
+ Image_PixMapData<Image_ColorBGRA>& aDataBGRA = anImage->EditData<Image_ColorBGRA>();
+ Image_PixMapData<Standard_Byte>& aDataGray = anImageA->EditData<Standard_Byte>();
+
+ // we draw a set of circles
+ Image_ColorBGRA aColor32;
+ aColor32.a() = 255;
+ Standard_Real aHLS[3];
+ while (aScale >= 1.0f)
+ {
+ Quantity_Color::RgbHls (aColor.r(), aColor.g(), aColor.b(), aHLS[0], aHLS[1], aHLS[2]);
+ aHLS[2] *= 0.95; // 5% saturation change
+ Quantity_Color::HlsRgb (aHLS[0], aHLS[1], aHLS[2], aColor.r(), aColor.g(), aColor.b());
+ aColor32.r() = Standard_Byte(255.0 * aColor.r());
+ aColor32.g() = Standard_Byte(255.0 * aColor.g());
+ aColor32.b() = Standard_Byte(255.0 * aColor.b());
+
+ const Handle(Graphic3d_MarkerImage) aMarker = GetTextureImage (Aspect_TOM_O, aScale);
+ const Handle(Image_PixMap)& aCircle = aMarker->GetImage();
+
+ const Standard_Size aDiffX = (aDataBGRA.SizeX() - aCircle->SizeX()) / 2;
+ const Standard_Size aDiffY = (aDataBGRA.SizeY() - aCircle->SizeY()) / 2;
+ for (Standard_Size aRow = 0; aRow < aCircle->SizeY(); ++aRow)
+ {
+ const Standard_Byte* aRowData = aCircle->Row (aRow);
+ for (Standard_Size aCol = 0; aCol < aCircle->SizeX(); ++aCol)
+ {
+ if (aRowData[aCol] != 0)
+ {
+ aDataBGRA.ChangeValue (aDiffX + aRow, aDiffY + aCol) = aColor32;
+ aDataGray.ChangeValue (aDiffX + aRow, aDiffY + aCol) = 255;
+ }
+ }
+ }
+ aScale -= aDelta;
+ }
+ break;
+ }
+ default:
+ {
+ aNewMarkerImage = GetTextureImage (myType, myScale);
+ anImage = aNewMarkerImage->GetImage();
+ break;
+ }
+ }
+ }
+
+ myMarkerSize = Max ((Standard_ShortReal )anImage->Width(),(Standard_ShortReal )anImage->Height());
+
+ mySprite->Init (theCtx, *anImage.operator->(), Graphic3d_TOT_2D);
+ if (anImageA.IsNull()
+ && mySprite->GetFormat() != GL_ALPHA8
+ && !aNewMarkerImage.IsNull())
+ {
+ anImageA = aNewMarkerImage->GetImageAlpha();
+ }
+ if (!anImageA.IsNull())
+ {
+ mySpriteA->Init (theCtx, *anImageA.operator->(), Graphic3d_TOT_2D);
+ }
+ }
+ else
+ {
+ // Creating list with bitmap for using it in compatibility mode
+ GLuint aBitmapList = glGenLists (1);
+ mySprite->SetDisplayList (theCtx, aBitmapList);
+
+ Standard_Integer aWidth, aHeight, anOffset, aNumOfBytes;
+ if (myType == Aspect_TOM_USERDEFINED && !theAspect.MarkerImage.IsNull())
+ {
+ // Reading userdefined marker
+ Handle(TColStd_HArray1OfByte) aBitMap = theAspect.MarkerImage->GetBitMapArray();
+ Standard_Byte* aBitMapArray = new Standard_Byte[aBitMap->Length()];
+ theAspect.MarkerImage->GetTextureSize (aWidth, aHeight);
+
+ // We should pass bitmap to glBitmap with reversed line order as it draws it from
+ // bottom to top
+ const Standard_Integer aNumOfBytesInRow = aWidth / 8 + (aWidth % 8 ? 1 : 0);
+ const Standard_Integer anUpperIndex = aBitMap->Upper();
+ for (Standard_Integer aRow = 0; aRow < aHeight; aRow++)
+ {
+ for (Standard_Integer aByteIter = 0; aByteIter < aNumOfBytesInRow; aByteIter++)
+ {
+ aBitMapArray[aRow * aNumOfBytesInRow + aByteIter] =
+ aBitMap->Value (anUpperIndex + 1 - (aRow + 1) * aNumOfBytesInRow + aByteIter);
+ }
+ }
+
+ if (aBitMapArray != NULL)
+ {
+ glNewList (aBitmapList, GL_COMPILE);
+ glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, (GLfloat )(0.5f * aWidth), (GLfloat )(0.5f * aHeight),
+ 0.f, 0.f, (const GLubyte* )aBitMapArray);
+ glEndList();
+ }
+ }
+ else
+ {
+ // Creating list for default marker
+ const Standard_ShortReal aDelta = 0.1f;
+ Standard_ShortReal aScale = myScale;
+ Standard_ShortReal aLimit = 0.0f;
+
+ glNewList (aBitmapList, GL_COMPILE);
+ switch (myType)
+ {
+ case Aspect_TOM_O_PLUS:
+ case Aspect_TOM_O_STAR:
+ case Aspect_TOM_O_X:
+ {
+ // For this type of markers we merge two base bitmaps into one
+ // For example Aspect_TOM_O_PLUS = Aspect_TOM_O + Aspect_TOM_PLUS
+ GetMarkerBitMapParam (Aspect_TOM_O, myScale, aWidth, aHeight, anOffset, aNumOfBytes);
+ glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, (GLfloat )(0.5f * aWidth), (GLfloat )(0.5f * aHeight),
+ 0.f, 0.f, (const GLubyte* )&OpenGl_AspectMarker_myMarkerRaster[anOffset]);
+ GetMarkerBitMapParam (Aspect_TypeOfMarker (myType - Aspect_TOM_O_POINT), myScale, aWidth, aHeight, anOffset, aNumOfBytes);
+ glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, (GLfloat )(0.5f * aWidth), (GLfloat )(0.5f * aHeight),
+ 0.f, 0.f, (const GLubyte* )&OpenGl_AspectMarker_myMarkerRaster[anOffset]);
+ break;
+ }
+ case Aspect_TOM_BALL:
+ {
+ const Standard_ShortReal aDelta = 0.1f;
+ NCollection_Vec4<Standard_Real> aColor (Standard_Real (myColor.rgb[0]),
+ Standard_Real (myColor.rgb[1]),
+ Standard_Real (myColor.rgb[2]),
+ Standard_Real (myColor.rgb[3]));
+
+ // we draw a set of circles
+ while (aScale >= 1.0f)
+ {
+ Standard_Real aHLS[3];
+ Quantity_Color::RgbHls (aColor.r(), aColor.g(), aColor.b(), aHLS[0], aHLS[1], aHLS[2]);
+ // 5% saturation change
+ aHLS[2] *= 0.95;
+ Quantity_Color::HlsRgb (aHLS[0], aHLS[1], aHLS[2], aColor.r(), aColor.g(), aColor.b());
+
+ glColor4dv (aColor);
+ GetMarkerBitMapParam (Aspect_TOM_O, aScale, aWidth, aHeight, anOffset, aNumOfBytes);
+ glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, 0.5f * GLfloat(aWidth), 0.5f * GLfloat(aHeight),
+ 0.0f, 0.0f, (const GLubyte* )&OpenGl_AspectMarker_myMarkerRaster[anOffset]);
+
+ aScale -= aDelta;
+ }
+ break;
+ }
+ case Aspect_TOM_RING1:
+ if (aLimit == 0.0f) aLimit = aScale * 0.2f;
+ case Aspect_TOM_RING2:
+ if (aLimit == 0.0f) aLimit = aScale * 0.5f;
+ case Aspect_TOM_RING3:
+ {
+ if (aLimit == 0.0f) aLimit = aScale * 0.8f;
+ for (; aScale > aLimit && aScale >= 1.0f; aScale -= aDelta)
+ {
+ GetMarkerBitMapParam (Aspect_TOM_O, aScale, aWidth, aHeight, anOffset, aNumOfBytes);
+ glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, 0.5f * GLfloat(aWidth), 0.5f * GLfloat(aHeight),
+ 0.0f, 0.0f, (const GLubyte* )&OpenGl_AspectMarker_myMarkerRaster[anOffset]);
+ }
+ break;
+ }
+ default:
+ {
+ GetMarkerBitMapParam (myType, myScale, aWidth, aHeight, anOffset, aNumOfBytes);
+ glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, 0.5f * GLfloat(aWidth), 0.5f * GLfloat(aHeight),
+ 0.0f, 0.0f, (const GLubyte* )&OpenGl_AspectMarker_myMarkerRaster[anOffset]);
+ break;
+ }
+ }
+ glEndList();
+ }
+ }
+}
+// =======================================================================
+// function : Render
+// purpose :
+// =======================================================================
void OpenGl_AspectMarker::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
{
- theWorkspace->SetAspectMarker(this);
+ theWorkspace->SetAspectMarker (this);
}
-void OpenGl_AspectMarker::Release (const Handle(OpenGl_Context)&)
+// =======================================================================
+// function : Release
+// purpose :
+// =======================================================================
+void OpenGl_AspectMarker::Release (const Handle(OpenGl_Context)& theCtx)
{
- //
+ if (!mySprite.IsNull())
+ {
+ if (!theCtx.IsNull())
+ {
+ if (mySpriteKey.IsEmpty())
+ {
+ theCtx->DelayedRelease (mySprite);
+ theCtx->DelayedRelease (mySpriteA);
+ }
+ else
+ {
+ mySprite.Nullify(); // we need nullify all handles before ReleaseResource() call
+ mySpriteA.Nullify();
+ theCtx->ReleaseResource (mySpriteKey);
+ theCtx->ReleaseResource (mySpriteAKey);
+ }
+ }
+ mySprite.Nullify();
+ mySpriteA.Nullify();
+ }
+ mySpriteKey.Clear();
+ mySpriteAKey.Clear();
}
#include <InterfaceGraphic_Graphic3d.hxx>
#include <Aspect_TypeOfMarker.hxx>
+#include <Graphic3d_CGroup.hxx>
+#include <TCollection_AsciiString.hxx>
#include <OpenGl_Element.hxx>
+#include <Handle_OpenGl_PointSprite.hxx>
+
+#include <Image_PixMap_Handle.hxx>
class OpenGl_AspectMarker : public OpenGl_Element
{
- public:
+public:
- OpenGl_AspectMarker ();
+ OpenGl_AspectMarker();
- void SetContext (const CALL_DEF_CONTEXTMARKER &AContext);
+ void Init (const Handle(OpenGl_Context)& theContext,
+ const CALL_DEF_CONTEXTMARKER& theAspect);
- const TEL_COLOUR & Color() const { return myColor; }
- Aspect_TypeOfMarker Type() const { return myType; }
- float Scale() const { return myScale; }
+ const TEL_COLOUR& Color() const { return myColor; }
+ Aspect_TypeOfMarker Type() const { return myType; }
+ Standard_ShortReal Scale() const { return myScale; }
+ Standard_ShortReal MarkerSize() const { return myMarkerSize; }
+ const Handle(OpenGl_PointSprite)& Sprite() const { return mySprite; }
+ const Handle(OpenGl_PointSprite)& SpriteHighlight() const { return mySpriteA; }
virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
virtual void Release (const Handle(OpenGl_Context)& theContext);
- protected:
+protected:
+
+ TEL_COLOUR myColor;
+ Aspect_TypeOfMarker myType;
+ Standard_ShortReal myScale;
+ Standard_ShortReal myMarkerSize;
+ TCollection_AsciiString mySpriteKey; //!< shared resource ID
+ TCollection_AsciiString mySpriteAKey; //!< shared resource ID
+ Handle(OpenGl_PointSprite) mySprite; //!< normal sprite
+ Handle(OpenGl_PointSprite) mySpriteA; //!< extra alphs-only sprite for RGB sprites
- TEL_COLOUR myColor;
- Aspect_TypeOfMarker myType;
- float myScale;
+public:
- public:
DEFINE_STANDARD_ALLOC
+
};
-#endif //OpenGl_AspectMarker_Header
+#endif // OpenGl_AspectMarker_Header
// purpose :
// =======================================================================
OpenGl_Caps::OpenGl_Caps()
-: vboDisable (Standard_False),
- contextDebug (Standard_False)
+: vboDisable (Standard_False),
+ pntSpritesDisable (Standard_False),
+ contextDebug (Standard_False)
{
//
}
// =======================================================================
OpenGl_Caps& OpenGl_Caps::operator= (const OpenGl_Caps& theCopy)
{
- vboDisable = theCopy.vboDisable;
- contextDebug = theCopy.contextDebug;
+ vboDisable = theCopy.vboDisable;
+ pntSpritesDisable = theCopy.pntSpritesDisable;
+ contextDebug = theCopy.contextDebug;
return *this;
}
public: //! @name flags to disable particular functionality
- Standard_Boolean vboDisable; //!< flag permits VBO usage, will significantly affect performance (OFF by default)
+ Standard_Boolean vboDisable; //!< flag permits VBO usage, will significantly affect performance (OFF by default)
+ Standard_Boolean pntSpritesDisable; //!< flag permits Point Sprites usage, will significantly affect performance (OFF by default)
public: //! @name context creation parameters
myOffsetUnits(0.F),
myAntiAliasingMode(3),
myLinestyleBase(0),
- myPatternBase(0),
- myMarkerBase(0)
+ myPatternBase(0)
{
#if (defined(_WIN32) || defined(__WIN32__)) || (defined(__APPLE__) && !defined(MACOSX_USE_GLX))
myDisplay = TheDummyDisplay;
glDeleteLists((GLuint)myPatternBase,TEL_HS_USER_DEF_START);
myPatternBase = 0;
}
- // Delete markers
- if (myMarkerBase)
- {
- glDeleteLists((GLuint)myMarkerBase,60);
- myMarkerBase = 0;
- }
- // Delete user markers
- OpenGl_MapOfUserMarker::Iterator itm(myMapOfUM);
- for (; itm.More(); itm.Next())
- {
- const OPENGL_MARKER_DATA &aData = itm.Value();
- if (aData.Array)
- {
- delete[] aData.Array;
- }
- else if (aData.ListId != 0)
- {
- glDeleteLists ( aData.ListId, 1 );
- }
- }
+
myDisplay = NULL;
}
/*----------------------------------------------------------------------*/
-//GenerateMarkerBitmap
-void OpenGl_Display::AddUserMarker (const Standard_Integer AIndex,
- const Standard_Integer AMarkWidth,
- const Standard_Integer AMarkHeight,
- const Handle(TColStd_HArray1OfByte)& ATexture)
-{
- if (!myMapOfUM.IsBound(AIndex))
- {
- const OPENGL_MARKER_DATA anEmptyData = { 0, 0, 0, NULL };
- myMapOfUM.Bind(AIndex,anEmptyData);
- }
-
- OPENGL_MARKER_DATA &aData = myMapOfUM.ChangeFind(AIndex);
-
- if (aData.Array)
- {
- delete[] aData.Array;
- aData.Array = NULL;
- }
-
- unsigned char *anArray = new unsigned char[ATexture->Length()];
-
- const int aByteWidth = AMarkWidth / 8;
- int i, anIndex = ATexture->Upper() - ATexture->Lower() - aByteWidth + 1;
- for ( ; anIndex >= 0; anIndex -= aByteWidth )
- for ( i = 0; i < aByteWidth; i++ )
- anArray[ATexture->Upper() - ATexture->Lower() - aByteWidth + 1 - anIndex + i ] = ATexture->Value( anIndex + i + 1 );
-
- aData.Width = AMarkWidth;
- aData.Height = AMarkHeight;
- aData.Array = anArray;
-}
-
-/*----------------------------------------------------------------------*/
-
-void OpenGl_Display::UpdateUserMarkers ()
-{
- OpenGl_MapOfUserMarker::Iterator itm(myMapOfUM);
- for (; itm.More(); itm.Next())
- {
- OPENGL_MARKER_DATA &aData = itm.ChangeValue();
- if (aData.Array)
- {
- if (aData.ListId == 0)
- aData.ListId = glGenLists(1);
-
- glNewList( (GLuint)aData.ListId, GL_COMPILE );
-
- GLint w = ( GLsizei ) aData.Width;
- GLint h = ( GLsizei ) aData.Height;
- glBitmap( w, h,
- 0.5F * ( float )aData.Width, 0.5F * ( float )aData.Height,
- ( float )30.0, ( float )30.0,
- ( GLubyte* )aData.Array );
-
- glEndList();
-
- delete[] aData.Array;
- aData.Array = NULL;
- }
- }
-}
-
-/*----------------------------------------------------------------------*/
-
-Standard_Integer OpenGl_Display::GetUserMarkerListIndex (const Standard_Integer AIndex) const
-{
- if (myMapOfUM.IsBound(AIndex))
- {
- const OPENGL_MARKER_DATA &aData = myMapOfUM.Find(AIndex);
- if (!aData.Array)
- return aData.ListId;
- }
- return -1;
-}
-
-/*----------------------------------------------------------------------*/
-
void OpenGl_Display::Init()
{
if (myDisplay != NULL)
int MaxViews;
};
-struct OPENGL_MARKER_DATA
-{
- unsigned int ListId;
- unsigned int Width;
- unsigned int Height;
- unsigned char* Array;
- DEFINE_STANDARD_ALLOC
-};
-
-typedef NCollection_DataMap<int,OPENGL_MARKER_DATA> OpenGl_MapOfUserMarker;
-
class OpenGl_AspectText;
struct OpenGl_TextParam;
void InitAttributes ();
- const char * GetStringForMarker (const Aspect_TypeOfMarker AType, const Tfloat AVal) const;
-
- void SetBaseForMarker () const;
-
void SetTypeOfLine (const Aspect_TypeOfLine AType) const;
void SetTypeOfHatch (const int AType) const;
- // User markers
-
- void AddUserMarker (const Standard_Integer AIndex,
- const Standard_Integer AMarkWidth,
- const Standard_Integer AMarkHeight,
- const Handle(TColStd_HArray1OfByte)& ATexture);
-
- void UpdateUserMarkers ();
-
- Standard_Integer GetUserMarkerListIndex (const Standard_Integer AIndex) const;
-
friend class OpenGl_Window;
// Type definition
unsigned int myLinestyleBase;
unsigned int myPatternBase;
- unsigned int myMarkerBase;
-
- OpenGl_MapOfUserMarker myMapOfUM;
public:
DEFINE_STANDARD_ALLOC
}
};
-/* Following Section relates to POLYMARKER */
-
-#define TEL_NO_OF_SIZES 13
-#define TEL_NB_OF_LISTS 5
-
-struct PM_FONT_INFO
-{
- const char *str;
- Tfloat width, height;
- Tint offset;
-};
-typedef PM_FONT_INFO* pm_font_info;
-
-#define PM_PLUS_10_NUM 9*2
-#define PM_PLUS_15_NUM 11*2
-#define PM_PLUS_20_NUM 13*2
-#define PM_PLUS_25_NUM 15*2
-#define PM_PLUS_30_NUM 17*3
-#define PM_PLUS_35_NUM 19*3
-#define PM_PLUS_40_NUM 21*3
-#define PM_PLUS_45_NUM 23*3
-#define PM_PLUS_50_NUM 25*4
-#define PM_PLUS_55_NUM 27*4
-#define PM_PLUS_60_NUM 29*4
-#define PM_PLUS_65_NUM 31*4
-#define PM_PLUS_70_NUM 32*4
-
-#define PM_STAR_10_NUM 9
-#define PM_STAR_15_NUM 11*2
-#define PM_STAR_20_NUM 13*2
-#define PM_STAR_25_NUM 15*2
-#define PM_STAR_30_NUM 17*2
-#define PM_STAR_35_NUM 19*2
-#define PM_STAR_40_NUM 21*3
-#define PM_STAR_45_NUM 23*3
-#define PM_STAR_50_NUM 25*3
-#define PM_STAR_55_NUM 27*3
-#define PM_STAR_60_NUM 29*4
-#define PM_STAR_65_NUM 32*4
-#define PM_STAR_70_NUM 32*4
-
-#define PM_CIRC_10_NUM 7
-#define PM_CIRC_15_NUM 9*2
-#define PM_CIRC_20_NUM 9*2
-#define PM_CIRC_25_NUM 11*2
-#define PM_CIRC_30_NUM 13*2
-#define PM_CIRC_35_NUM 15*2
-#define PM_CIRC_40_NUM 17*3
-#define PM_CIRC_45_NUM 19*3
-#define PM_CIRC_50_NUM 21*3
-#define PM_CIRC_55_NUM 23*3
-#define PM_CIRC_60_NUM 25*4
-#define PM_CIRC_65_NUM 27*4
-#define PM_CIRC_70_NUM 29*4
-
-#define PM_CROSS_10_NUM 7
-#define PM_CROSS_15_NUM 9*2
-#define PM_CROSS_20_NUM 11*2
-#define PM_CROSS_25_NUM 13*2
-#define PM_CROSS_30_NUM 15*2
-#define PM_CROSS_35_NUM 17*3
-#define PM_CROSS_40_NUM 19*3
-#define PM_CROSS_45_NUM 21*3
-#define PM_CROSS_50_NUM 23*3
-#define PM_CROSS_55_NUM 25*4
-#define PM_CROSS_60_NUM 27*4
-#define PM_CROSS_65_NUM 32*4
-#define PM_CROSS_70_NUM 32*4
-
-#define PM_PLUS_10_OFT 0
-#define PM_PLUS_15_OFT PM_PLUS_10_OFT + PM_PLUS_10_NUM
-#define PM_PLUS_20_OFT PM_PLUS_15_OFT + PM_PLUS_15_NUM
-#define PM_PLUS_25_OFT PM_PLUS_20_OFT + PM_PLUS_20_NUM
-#define PM_PLUS_30_OFT PM_PLUS_25_OFT + PM_PLUS_25_NUM
-#define PM_PLUS_35_OFT PM_PLUS_30_OFT + PM_PLUS_30_NUM
-#define PM_PLUS_40_OFT PM_PLUS_35_OFT + PM_PLUS_35_NUM
-#define PM_PLUS_45_OFT PM_PLUS_40_OFT + PM_PLUS_40_NUM
-#define PM_PLUS_50_OFT PM_PLUS_45_OFT + PM_PLUS_45_NUM
-#define PM_PLUS_55_OFT PM_PLUS_50_OFT + PM_PLUS_50_NUM
-#define PM_PLUS_60_OFT PM_PLUS_55_OFT + PM_PLUS_55_NUM
-#define PM_PLUS_65_OFT PM_PLUS_60_OFT + PM_PLUS_60_NUM
-#define PM_PLUS_70_OFT PM_PLUS_65_OFT + PM_PLUS_65_NUM
-
-#define PM_STAR_10_OFT PM_PLUS_70_OFT + PM_PLUS_70_NUM
-#define PM_STAR_15_OFT PM_STAR_10_OFT + PM_STAR_10_NUM
-#define PM_STAR_20_OFT PM_STAR_15_OFT + PM_STAR_15_NUM
-#define PM_STAR_25_OFT PM_STAR_20_OFT + PM_STAR_20_NUM
-#define PM_STAR_30_OFT PM_STAR_25_OFT + PM_STAR_25_NUM
-#define PM_STAR_35_OFT PM_STAR_30_OFT + PM_STAR_30_NUM
-#define PM_STAR_40_OFT PM_STAR_35_OFT + PM_STAR_35_NUM
-#define PM_STAR_45_OFT PM_STAR_40_OFT + PM_STAR_40_NUM
-#define PM_STAR_50_OFT PM_STAR_45_OFT + PM_STAR_45_NUM
-#define PM_STAR_55_OFT PM_STAR_50_OFT + PM_STAR_50_NUM
-#define PM_STAR_60_OFT PM_STAR_55_OFT + PM_STAR_55_NUM
-#define PM_STAR_65_OFT PM_STAR_60_OFT + PM_STAR_60_NUM
-#define PM_STAR_70_OFT PM_STAR_65_OFT + PM_STAR_65_NUM
-
-#define PM_CIRC_10_OFT PM_STAR_70_OFT + PM_STAR_70_NUM
-#define PM_CIRC_15_OFT PM_CIRC_10_OFT + PM_CIRC_10_NUM
-#define PM_CIRC_20_OFT PM_CIRC_15_OFT + PM_CIRC_15_NUM
-#define PM_CIRC_25_OFT PM_CIRC_20_OFT + PM_CIRC_20_NUM
-#define PM_CIRC_30_OFT PM_CIRC_25_OFT + PM_CIRC_25_NUM
-#define PM_CIRC_35_OFT PM_CIRC_30_OFT + PM_CIRC_30_NUM
-#define PM_CIRC_40_OFT PM_CIRC_35_OFT + PM_CIRC_35_NUM
-#define PM_CIRC_45_OFT PM_CIRC_40_OFT + PM_CIRC_40_NUM
-#define PM_CIRC_50_OFT PM_CIRC_45_OFT + PM_CIRC_45_NUM
-#define PM_CIRC_55_OFT PM_CIRC_50_OFT + PM_CIRC_50_NUM
-#define PM_CIRC_60_OFT PM_CIRC_55_OFT + PM_CIRC_55_NUM
-#define PM_CIRC_65_OFT PM_CIRC_60_OFT + PM_CIRC_60_NUM
-#define PM_CIRC_70_OFT PM_CIRC_65_OFT + PM_CIRC_65_NUM
-
-#define PM_CROSS_10_OFT PM_CIRC_70_OFT + PM_CIRC_70_NUM
-#define PM_CROSS_15_OFT PM_CROSS_10_OFT + PM_CROSS_10_NUM
-#define PM_CROSS_20_OFT PM_CROSS_15_OFT + PM_CROSS_15_NUM
-#define PM_CROSS_25_OFT PM_CROSS_20_OFT + PM_CROSS_20_NUM
-#define PM_CROSS_30_OFT PM_CROSS_25_OFT + PM_CROSS_25_NUM
-#define PM_CROSS_35_OFT PM_CROSS_30_OFT + PM_CROSS_30_NUM
-#define PM_CROSS_40_OFT PM_CROSS_35_OFT + PM_CROSS_35_NUM
-#define PM_CROSS_45_OFT PM_CROSS_40_OFT + PM_CROSS_40_NUM
-#define PM_CROSS_50_OFT PM_CROSS_45_OFT + PM_CROSS_45_NUM
-#define PM_CROSS_55_OFT PM_CROSS_50_OFT + PM_CROSS_50_NUM
-#define PM_CROSS_60_OFT PM_CROSS_55_OFT + PM_CROSS_55_NUM
-#define PM_CROSS_65_OFT PM_CROSS_60_OFT + PM_CROSS_60_NUM
-#define PM_CROSS_70_OFT PM_CROSS_65_OFT + PM_CROSS_65_NUM
-
-static const PM_FONT_INFO arrPMFontInfo[][TEL_NO_OF_SIZES] =
-{
- /* TOM_POINT - not used */
- {{"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"}},
-
- /* TOM_PLUS */
- {{"\001", 9.f, 9.f, PM_PLUS_10_OFT},
- {"\002", 11.f, 11.f, PM_PLUS_15_OFT},
- {"\003", 13.f, 13.f, PM_PLUS_20_OFT},
- {"\004", 15.f, 15.f, PM_PLUS_25_OFT},
- {"\005", 17.f, 17.f, PM_PLUS_30_OFT},
- {"\006", 19.f, 19.f, PM_PLUS_35_OFT},
- {"\007", 21.f, 21.f, PM_PLUS_40_OFT},
- {"\010", 23.f, 23.f, PM_PLUS_45_OFT},
- {"\011", 25.f, 25.f, PM_PLUS_50_OFT},
- {"\012", 27.f, 27.f, PM_PLUS_55_OFT},
- {"\013", 29.f, 29.f, PM_PLUS_60_OFT},
- {"\014", 31.f, 31.f, PM_PLUS_65_OFT},
- {"\015", 32.f, 32.f, PM_PLUS_70_OFT}},
-
- /* TOM_STAR */
- {{"\016", 7.f, 9.f, PM_STAR_10_OFT},
- {"\017", 9.f, 11.f, PM_STAR_15_OFT},
- {"\020", 11.f, 13.f, PM_STAR_20_OFT},
- {"\021", 13.f, 15.f, PM_STAR_25_OFT},
- {"\022", 13.f, 17.f, PM_STAR_30_OFT},
- {"\023", 15.f, 19.f, PM_STAR_35_OFT},
- {"\024", 17.f, 21.f, PM_STAR_40_OFT},
- {"\025", 19.f, 23.f, PM_STAR_45_OFT},
- {"\026", 21.f, 25.f, PM_STAR_50_OFT},
- {"\027", 23.f, 27.f, PM_STAR_55_OFT},
- {"\030", 25.f, 29.f, PM_STAR_60_OFT},
- {"\031", 32.f, 32.f, PM_STAR_65_OFT},
- {"\032", 32.f, 32.f, PM_STAR_70_OFT}},
-
- /* TOM_O */
- {{"\033", 7.f, 7.f, PM_CIRC_10_OFT},
- {"\034", 9.f, 9.f, PM_CIRC_15_OFT},
- {"\035", 9.f, 9.f, PM_CIRC_20_OFT},
- {"\036", 11.f, 11.f, PM_CIRC_25_OFT},
- {"\037", 13.f, 13.f, PM_CIRC_30_OFT},
- {"\040", 15.f, 15.f, PM_CIRC_35_OFT},
- {"\041", 17.f, 17.f, PM_CIRC_40_OFT},
- {"\042", 19.f, 19.f, PM_CIRC_45_OFT},
- {"\043", 21.f, 21.f, PM_CIRC_50_OFT},
- {"\044", 23.f, 23.f, PM_CIRC_55_OFT},
- {"\045", 25.f, 25.f, PM_CIRC_60_OFT},
- {"\046", 27.f, 27.f, PM_CIRC_65_OFT},
- {"\047", 29.f, 29.f, PM_CIRC_70_OFT}},
-
- /* TOM_X */
- {{"\050", 7.f, 7.f, PM_CROSS_10_OFT},
- {"\051", 9.f, 9.f, PM_CROSS_15_OFT},
- {"\052", 11.f, 11.f, PM_CROSS_20_OFT},
- {"\053", 13.f, 13.f, PM_CROSS_25_OFT},
- {"\054", 15.f, 15.f, PM_CROSS_30_OFT},
- {"\055", 17.f, 17.f, PM_CROSS_35_OFT},
- {"\056", 19.f, 19.f, PM_CROSS_40_OFT},
- {"\057", 21.f, 21.f, PM_CROSS_45_OFT},
- {"\060", 23.f, 23.f, PM_CROSS_50_OFT},
- {"\061", 25.f, 25.f, PM_CROSS_55_OFT},
- {"\062", 27.f, 27.f, PM_CROSS_60_OFT},
- {"\063", 32.f, 32.f, PM_CROSS_65_OFT},
- {"\064", 32.f, 32.f, PM_CROSS_70_OFT}},
-
- /* TOM_O_POINT - not used */
- {{"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"},
- {"\0"}},
-
- /* TOM_O_PLUS */
- {{"\001\033"},
- {"\002\034"},
- {"\003\035"},
- {"\004\036"},
- {"\005\037"},
- {"\006\040"},
- {"\007\041"},
- {"\010\042"},
- {"\011\043"},
- {"\012\044"},
- {"\013\045"},
- {"\014\046"},
- {"\015\047"}},
-
- /* TOM_O_STAR */
- {{"\016\033"},
- {"\017\034"},
- {"\020\035"},
- {"\021\036"},
- {"\022\037"},
- {"\023\040"},
- {"\024\041"},
- {"\025\042"},
- {"\026\043"},
- {"\027\044"},
- {"\030\045"},
- {"\031\046"},
- {"\032\047"}},
-
- /* TOM_O_X */
- {{"\050\033"},
- {"\051\034"},
- {"\052\035"},
- {"\053\036"},
- {"\054\037"},
- {"\055\040"},
- {"\056\041"},
- {"\057\042"},
- {"\060\043"},
- {"\061\044"},
- {"\062\045"},
- {"\063\046"},
- {"\064\047"}}
-};
-
-static const unsigned char myMarkerRaster[] =
-{
- /* TYPE = PLUS */
-
- 0x08,0x00,
- 0x08,0x00,
- 0x08,0x00,
- 0x08,0x00,
- 0xff,0x80,
- 0x08,0x00,
- 0x08,0x00,
- 0x08,0x00,
- 0x08,0x00, /* PLUS 9x9 = 1.0 */
-
- 0x04,0x00,
- 0x04,0x00,
- 0x04,0x00,
- 0x04,0x00,
- 0x04,0x00,
- 0xff,0xe0,
- 0x04,0x00,
- 0x04,0x00,
- 0x04,0x00,
- 0x04,0x00,
- 0x04,0x00, /* PLUS 11x11 = 1.5 */
-
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0xff,0xf8,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,/* PLUS 13x13 = 2.0 */
-
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0xff,0xfe,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,/* PLUS 15x15 = 2.5 */
-
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0xff,0xff, 0x80,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,/* PLUS 17x17 = 3.0 */
-
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0xff,0xff, 0xe0,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,/* PLUS 19x19 = 3.5 */
-
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0xff,0xff, 0xf8,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,/* PLUS 21x21 = 4.0 */
-
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0xff,0xff, 0xfe,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,/* PLUS 23x23 = 4.5 */
-
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0xff,0xff, 0xff,0x80,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,/* PLUS 25x25 = 5.0 */
-
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0xff,0xff, 0xff,0xe0,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,/* PLUS 27x27 = 5.5 */
-
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0xff,0xff, 0xff,0xf8,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,
- 0x00,0x02, 0x00,0x00,/* PLUS 29x29 = 6.0 */
-
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0xff,0xff, 0xff,0xfd,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,
- 0x00,0x01, 0x00,0x00,/* PLUS 31x31 = 6.5 */
-
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0xff,0xff, 0xff,0xff,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,/* PLUS 32x32 = 7.0 */
-
- /* TYPE = STAR */
-
- 0x10,
- 0x10,
- 0xd6,
- 0x38,
- 0x10,
- 0x38,
- 0xd6,
- 0x10,
- 0x10,/* STAR 7x9 = 1.0 */
-
- 0x08,0x00,
- 0x08,0x00,
- 0x08,0x00,
- 0xc9,0x80,
- 0x3e,0x00,
- 0x08,0x00,
- 0x3e,0x00,
- 0xc9,0x80,
- 0x08,0x00,
- 0x08,0x00,
- 0x08,0x00,/* STAR 9x11 = 1.5 */
-
- 0x04,0x00,
- 0x04,0x00,
- 0x04,0x00,
- 0x84,0x20,
- 0x64,0xc0,
- 0x1f,0x00,
- 0x04,0x00,
- 0x1f,0x00,
- 0x64,0xc0,
- 0x84,0x20,
- 0x04,0x00,
- 0x04,0x00,
- 0x04,0x00,/* STAR 11x13 = 2.0 */
-
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x82,0x18,
- 0x62,0x60,
- 0x1b,0x80,
- 0x06,0x00,
- 0x1b,0x80,
- 0x62,0x60,
- 0x82,0x18,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,/* STAR 13x15 = 2.5 */
-
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x82,0x08,
- 0x62,0x30,
- 0x12,0x40,
- 0x0f,0x80,
- 0x02,0x00,
- 0x0f,0x80,
- 0x12,0x40,
- 0x62,0x30,
- 0x82,0x08,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,
- 0x02,0x00,/* STAR 13x17 = 3.0 */
-
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0xc1,0x06,
- 0x21,0x18,
- 0x19,0x20,
- 0x07,0xc0,
- 0x01,0x00,
- 0x07,0xc0,
- 0x19,0x20,
- 0x21,0x18,
- 0xc1,0x06,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,
- 0x01,0x00,/* STAR 15x19 = 3.5 */
-
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x80,0x80, 0x80,
- 0x60,0x83, 0x00,
- 0x10,0x8c, 0x00,
- 0x0c,0x90, 0x00,
- 0x03,0xe0, 0x00,
- 0x00,0x80, 0x00,
- 0x03,0xe0, 0x00,
- 0x0c,0x90, 0x00,
- 0x10,0x8c, 0x00,
- 0x60,0x83, 0x00,
- 0x80,0x80, 0x80,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,
- 0x00,0x80, 0x00,/* STAR 17x21 = 4.0 */
-
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0xc0,0x40, 0x60,
- 0x30,0x41, 0x80,
- 0x08,0x42, 0x00,
- 0x06,0x4c, 0x00,
- 0x01,0xf0, 0x00,
- 0x00,0x40, 0x00,
- 0x01,0xf0, 0x00,
- 0x06,0x4c, 0x00,
- 0x08,0x42, 0x00,
- 0x30,0x41, 0x80,
- 0xc0,0x40, 0x60,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0x40, 0x00,/* STAR 19x23 = 4.5 */
-
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x80,0x20, 0x08,
- 0x60,0x20, 0x30,
- 0x18,0x20, 0xc0,
- 0x04,0x21, 0x00,
- 0x03,0x26, 0x00,
- 0x00,0xf8, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0xf8, 0x00,
- 0x03,0x26, 0x00,
- 0x04,0x21, 0x00,
- 0x18,0x20, 0xc0,
- 0x60,0x20, 0x30,
- 0x80,0x20, 0x08,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x20, 0x00,/* STAR 21x25 = 5.0 */
-
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0xc0,0x10, 0x06,
- 0x30,0x10, 0x18,
- 0x08,0x10, 0x60,
- 0x06,0x10, 0x80,
- 0x01,0x93, 0x00,
- 0x00,0x7c, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x7c, 0x00,
- 0x01,0x93, 0x00,
- 0x06,0x10, 0x80,
- 0x08,0x10, 0x60,
- 0x30,0x10, 0x18,
- 0xc0,0x10, 0x06,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x10, 0x00,/* STAR 23x27 = 5.5 */
-
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x80,0x08, 0x00,0x80,
- 0x60,0x08, 0x03,0x00,
- 0x18,0x08, 0x0c,0x00,
- 0x04,0x08, 0x30,0x00,
- 0x03,0x08, 0x40,0x00,
- 0x00,0xc9, 0x80,0x00,
- 0x00,0x3e, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x3e, 0x00,0x00,
- 0x00,0xc9, 0x80,0x00,
- 0x03,0x08, 0x40,0x00,
- 0x04,0x08, 0x30,0x00,
- 0x18,0x08, 0x0c,0x00,
- 0x60,0x08, 0x03,0x00,
- 0x80,0x08, 0x00,0x80,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,/* STAR 25x29 = 6.0 */
-
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x30,0x00, 0x80,0x06,
- 0x0c,0x00, 0x80,0x18,
- 0x03,0x00, 0x80,0x60,
- 0x00,0xc0, 0x81,0x80,
- 0x00,0x30, 0x86,0x00,
- 0x00,0x0c, 0x98,0x00,
- 0x00,0x03, 0xe0,0x00,
- 0x00,0x03, 0xe0,0x00,
- 0x00,0x0c, 0x98,0x00,
- 0x00,0x30, 0x86,0x00,
- 0x00,0xc0, 0x81,0x80,
- 0x03,0x00, 0x80,0x60,
- 0x0c,0x00, 0x80,0x18,
- 0x30,0x00, 0x80,0x06,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x80,0x00,
- 0x00,0x00, 0x00,0x00,
- 0x00,0x00, 0x00,0x00,/* STAR 32x32 = 6.5 */
-
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x10, 0x00, 0x80, 0x04,
- 0x0c, 0x00, 0x80, 0x18,
- 0x02, 0x00, 0x80, 0x20,
- 0x01, 0x80, 0x80, 0xc0,
- 0x00, 0x40, 0x81, 0x00,
- 0x00, 0x30, 0x86, 0x00,
- 0x00, 0x08, 0x88, 0x00,
- 0x00, 0x06, 0xb0, 0x00,
- 0x00, 0x01, 0xc0, 0x00,
- 0x00, 0x06, 0xb0, 0x00,
- 0x00, 0x08, 0x88, 0x00,
- 0x00, 0x30, 0x86, 0x00,
- 0x00, 0x40, 0x81, 0x00,
- 0x01, 0x80, 0x80, 0xc0,
- 0x02, 0x00, 0x80, 0x20,
- 0x0c, 0x00, 0x80, 0x18,
- 0x10, 0x00, 0x80, 0x04,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x80, 0x00,/* STAR 32x32 = 7.0 */
-
- /* TYPE = CIRC */
-
- 0x38,
- 0x44,
- 0x82,
- 0x82,
- 0x82,
- 0x44,
- 0x38,/* CIRC 7x7 = 1.0 */
-
- 0x3c,0x00,
- 0x42,0x00,
- 0x81,0x00,
- 0x81,0x00,
- 0x81,0x00,
- 0x81,0x00,
- 0x42,0x00,
- 0x3c,0x00,
- 0x00,0x00,/*CIRC 9x9 = 1.5 */
-
- 0x3e, 0x00,
- 0x41, 0x00,
- 0x81, 0x80,
- 0x80,0x80,
- 0x80,0x80,
- 0x80,0x80,
- 0x81, 0x80,
- 0x41, 0x00,
- 0x3e,0x00,/* CIRC 9x9 = 2.0 */
-
- 0x1f,0x00,
- 0x20,0x80,
- 0x40,0x40,
- 0x80,0x20,
- 0x80,0x20,
- 0x80,0x20,
- 0x80,0x20,
- 0x80,0x20,
- 0x40,0x40,
- 0x20,0x80,
- 0x1f,0x00,/* CIRC 11x11 = 2.5 */
-
- 0x0f,0x80,
- 0x10,0x40,
- 0x20,0x20,
- 0x40,0x10,
- 0x80,0x08,
- 0x80,0x08,
- 0x80,0x08,
- 0x80,0x08,
- 0x80,0x08,
- 0x40,0x10,
- 0x20,0x20,
- 0x10,0x40,
- 0x0f,0x80,/* CIRC 13x13 = 3.0 */
-
- 0x07,0xc0,
- 0x18,0x30,
- 0x20,0x08,
- 0x40,0x04,
- 0x40,0x04,
- 0x80,0x02,
- 0x80,0x02,
- 0x80,0x02,
- 0x80,0x02,
- 0x80,0x02,
- 0x40,0x04,
- 0x40,0x04,
- 0x20,0x08,
- 0x18,0x30,
- 0x07,0xc0,/* CIRC 15x15 = 3.5 */
-
- 0x03,0xe0, 0x00,
- 0x0c,0x18, 0x00,
- 0x10,0x04, 0x00,
- 0x20,0x02, 0x00,
- 0x40,0x01, 0x00,
- 0x40,0x01, 0x00,
- 0x80,0x00, 0x80,
- 0x80,0x00, 0x80,
- 0x80,0x00, 0x80,
- 0x80,0x00, 0x80,
- 0x80,0x00, 0x80,
- 0x40,0x01, 0x00,
- 0x40,0x01, 0x00,
- 0x20,0x02, 0x00,
- 0x10,0x04, 0x00,
- 0x0c,0x18, 0x00,
- 0x03,0xe0, 0x00,/* CIRC 17x17 = 4.0 */
-
- 0x03,0xf8, 0x00,
- 0x0e,0x0e, 0x00,
- 0x18,0x03, 0x00,
- 0x20,0x00, 0x80,
- 0x60,0x00, 0xc0,
- 0x40,0x00, 0x40,
- 0xc0,0x00, 0x60,
- 0x80,0x00, 0x20,
- 0x80,0x00, 0x20,
- 0x80,0x00, 0x20,
- 0x80,0x00, 0x20,
- 0x80,0x00, 0x20,
- 0xc0,0x00, 0x60,
- 0x40,0x00, 0x40,
- 0x60,0x00, 0xc0,
- 0x20,0x00, 0x80,
- 0x18,0x03, 0x00,
- 0x0e,0x0e, 0x00,
- 0x03,0xf8, 0x00,/* CIRC 19x19 = 4.5 */
-
- 0x01,0xfc, 0x00,
- 0x06,0x03, 0x00,
- 0x08,0x00, 0x80,
- 0x10,0x00, 0x40,
- 0x20,0x00, 0x20,
- 0x40,0x00, 0x10,
- 0x40,0x00, 0x10,
- 0x80,0x00, 0x08,
- 0x80,0x00, 0x08,
- 0x80,0x00, 0x08,
- 0x80,0x00, 0x08,
- 0x80,0x00, 0x08,
- 0x80,0x00, 0x08,
- 0x80,0x00, 0x08,
- 0x40,0x00, 0x10,
- 0x40,0x00, 0x10,
- 0x20,0x00, 0x20,
- 0x10,0x00, 0x40,
- 0x08,0x00, 0x80,
- 0x06,0x03, 0x00,
- 0x01,0xfc, 0x00,/* CIRC 21x21 = 5.0 */
-
- 0x00,0xfe, 0x00,
- 0x03,0x01, 0x80,
- 0x0c,0x00, 0x60,
- 0x18,0x00, 0x30,
- 0x30,0x00, 0x18,
- 0x20,0x00, 0x08,
- 0x40,0x00, 0x04,
- 0x40,0x00, 0x04,
- 0x80,0x00, 0x02,
- 0x80,0x00, 0x02,
- 0x80,0x00, 0x02,
- 0x80,0x00, 0x02,
- 0x80,0x00, 0x02,
- 0x80,0x00, 0x02,
- 0x80,0x00, 0x02,
- 0x40,0x00, 0x04,
- 0x40,0x00, 0x04,
- 0x20,0x00, 0x08,
- 0x30,0x00, 0x18,
- 0x18,0x00, 0x30,
- 0x0c,0x00, 0x60,
- 0x03,0x01, 0x80,
- 0x00,0xfe, 0x00,/* CIRC 23x23 = 5.5 */
-
- 0x00,0x7f, 0x00,0x00,
- 0x01,0x80, 0xc0,0x00,
- 0x06,0x00, 0x30,0x00,
- 0x08,0x00, 0x08,0x00,
- 0x10,0x00, 0x04,0x00,
- 0x20,0x00, 0x02,0x00,
- 0x20,0x00, 0x02,0x00,
- 0x40,0x00, 0x01,0x00,
- 0x40,0x00, 0x01,0x00,
- 0x80,0x00, 0x00,0x80,
- 0x80,0x00, 0x00,0x80,
- 0x80,0x00, 0x00,0x80,
- 0x80,0x00, 0x00,0x80,
- 0x80,0x00, 0x00,0x80,
- 0x80,0x00, 0x00,0x80,
- 0x80,0x00, 0x00,0x80,
- 0x40,0x00, 0x01,0x00,
- 0x40,0x00, 0x01,0x00,
- 0x20,0x00, 0x02,0x00,
- 0x20,0x00, 0x02,0x00,
- 0x10,0x00, 0x04,0x00,
- 0x08,0x00, 0x08,0x00,
- 0x06,0x00, 0x30,0x00,
- 0x01,0x80, 0xc0,0x00,
- 0x00,0x7f, 0x00,0x00,/* CIRC 25x25 = 6.0 */
-
- 0x00,0x3f, 0x80,0x00,
- 0x01,0xc0, 0x70,0x00,
- 0x03,0x00, 0x18,0x00,
- 0x0c,0x00, 0x06,0x00,
- 0x18,0x00, 0x03,0x00,
- 0x10,0x00, 0x01,0x00,
- 0x20,0x00, 0x00,0x80,
- 0x60,0x00, 0x00,0xc0,
- 0x40,0x00, 0x00,0x40,
- 0x40,0x00, 0x00,0x40,
- 0x80,0x00, 0x00,0x20,
- 0x80,0x00, 0x00,0x20,
- 0x80,0x00, 0x00,0x20,
- 0x80,0x00, 0x00,0x20,
- 0x80,0x00, 0x00,0x20,
- 0x80,0x00, 0x00,0x20,
- 0x80,0x00, 0x00,0x20,
- 0x40,0x00, 0x00,0x40,
- 0x40,0x00, 0x00,0x40,
- 0x60,0x00, 0x00,0xc0,
- 0x20,0x00, 0x00,0x80,
- 0x10,0x00, 0x01,0x00,
- 0x18,0x00, 0x03,0x00,
- 0x0c,0x00, 0x06,0x00,
- 0x03,0x00, 0x18,0x00,
- 0x01,0xc0, 0x70,0x00,
- 0x00,0x3f, 0x80,0x00,/* CIRC 27x27 = 6.5 */
-
- 0x00,0x1f, 0xc0,0x00,
- 0x00,0xe0, 0x38,0x00,
- 0x01,0x00, 0x04,0x00,
- 0x06,0x00, 0x03,0x00,
- 0x08,0x00, 0x00,0x80,
- 0x10,0x00, 0x00,0x40,
- 0x10,0x00, 0x00,0x40,
- 0x20,0x00, 0x00,0x20,
- 0x40,0x00, 0x00,0x10,
- 0x40,0x00, 0x00,0x10,
- 0x40,0x00, 0x00,0x10,
- 0x80,0x00, 0x00,0x08,
- 0x80,0x00, 0x00,0x08,
- 0x80,0x00, 0x00,0x08,
- 0x80,0x00, 0x00,0x08,
- 0x80,0x00, 0x00,0x08,
- 0x80,0x00, 0x00,0x08,
- 0x80,0x00, 0x00,0x08,
- 0x40,0x00, 0x00,0x10,
- 0x40,0x00, 0x00,0x10,
- 0x40,0x00, 0x00,0x10,
- 0x20,0x00, 0x00,0x20,
- 0x10,0x00, 0x00,0x40,
- 0x10,0x00, 0x00,0x40,
- 0x08,0x00, 0x00,0x80,
- 0x06,0x00, 0x03,0x00,
- 0x01,0x00, 0x04,0x00,
- 0x00,0xe0, 0x38,0x00,
- 0x00,0x1f, 0xc0,0x00, /* CIRC 29x29 = 7.0 */
-
- /* TYPE = CROSS */
-
- 0x82,
- 0x44,
- 0x28,
- 0x10,
- 0x28,
- 0x44,
- 0x82,/* CROSS 7x7 = 1.0 */
-
- 0x80,0x80,
- 0x41,0x00,
- 0x22,0x00,
- 0x14,0x00,
- 0x08,0x00,
- 0x14,0x00,
- 0x22,0x00,
- 0x41,0x00,
- 0x80,0x80,/* CROSS 9x9 = 1.5 */
-
- 0x80,0x20,
- 0x40,0x40,
- 0x20,0x80,
- 0x11,0x00,
- 0x0a,0x00,
- 0x04,0x00,
- 0x0a,0x00,
- 0x11,0x00,
- 0x20,0x80,
- 0x40,0x40,
- 0x80,0x20,/* CROSS 11x11 = 2.0 */
-
- 0x80,0x08,
- 0x40,0x10,
- 0x20,0x20,
- 0x10,0x40,
- 0x08,0x80,
- 0x05,0x00,
- 0x02,0x00,
- 0x05,0x00,
- 0x08,0x80,
- 0x10,0x40,
- 0x20,0x20,
- 0x40,0x10,
- 0x80,0x08,/* CROSS 13x13 = 2.5 */
-
- 0x80,0x02,
- 0x40,0x04,
- 0x20,0x08,
- 0x10,0x10,
- 0x08,0x20,
- 0x04,0x40,
- 0x02,0x80,
- 0x01,0x00,
- 0x02,0x80,
- 0x04,0x40,
- 0x08,0x20,
- 0x10,0x10,
- 0x20,0x08,
- 0x40,0x04,
- 0x80,0x02,/* CROSS 15x15 = 3.0 */
-
- 0x80,0x00, 0x80,
- 0x40,0x01, 0x00,
- 0x20,0x02, 0x00,
- 0x10,0x04, 0x00,
- 0x08,0x08, 0x00,
- 0x04,0x10, 0x00,
- 0x02,0x20, 0x00,
- 0x01,0x40, 0x00,
- 0x00,0x80, 0x00,
- 0x01,0x40, 0x00,
- 0x02,0x20, 0x00,
- 0x04,0x10, 0x00,
- 0x08,0x08, 0x00,
- 0x10,0x04, 0x00,
- 0x20,0x02, 0x00,
- 0x40,0x01, 0x00,
- 0x80,0x00, 0x80,/* CROSS 17x17 = 3.5 */
-
- 0x80,0x00, 0x20,
- 0x40,0x00, 0x40,
- 0x20,0x00, 0x80,
- 0x10,0x01, 0x00,
- 0x08,0x02, 0x00,
- 0x04,0x04, 0x00,
- 0x02,0x08, 0x00,
- 0x01,0x10, 0x00,
- 0x00,0xa0, 0x00,
- 0x00,0x40, 0x00,
- 0x00,0xa0, 0x00,
- 0x01,0x10, 0x00,
- 0x02,0x08, 0x00,
- 0x04,0x04, 0x00,
- 0x08,0x02, 0x00,
- 0x10,0x01, 0x00,
- 0x20,0x00, 0x80,
- 0x40,0x00, 0x40,
- 0x80,0x00, 0x20,/* CROSS 19x19 = 4.0 */
-
- 0x80,0x00, 0x08,
- 0x40,0x00, 0x10,
- 0x20,0x00, 0x20,
- 0x10,0x00, 0x40,
- 0x08,0x00, 0x80,
- 0x04,0x01, 0x00,
- 0x02,0x02, 0x00,
- 0x01,0x04, 0x00,
- 0x00,0x88, 0x00,
- 0x00,0x50, 0x00,
- 0x00,0x20, 0x00,
- 0x00,0x50, 0x00,
- 0x00,0x88, 0x00,
- 0x01,0x04, 0x00,
- 0x02,0x02, 0x00,
- 0x04,0x01, 0x00,
- 0x08,0x00, 0x80,
- 0x10,0x00, 0x40,
- 0x20,0x00, 0x20,
- 0x40,0x00, 0x10,
- 0x80,0x00, 0x08,/* CROSS 21x21 = 4.5 */
-
- 0x80,0x00, 0x02,
- 0x40,0x00, 0x04,
- 0x20,0x00, 0x08,
- 0x10,0x00, 0x10,
- 0x08,0x00, 0x20,
- 0x04,0x00, 0x40,
- 0x02,0x00, 0x80,
- 0x01,0x01, 0x00,
- 0x00,0x82, 0x00,
- 0x00,0x44, 0x00,
- 0x00,0x28, 0x00,
- 0x00,0x10, 0x00,
- 0x00,0x28, 0x00,
- 0x00,0x44, 0x00,
- 0x00,0x82, 0x00,
- 0x01,0x01, 0x00,
- 0x02,0x00, 0x80,
- 0x04,0x00, 0x40,
- 0x08,0x00, 0x20,
- 0x10,0x00, 0x10,
- 0x20,0x00, 0x08,
- 0x40,0x00, 0x04,
- 0x80,0x00, 0x02,/* CROSS 23x23 = 5.0 */
-
- 0x80,0x00, 0x00,0x80,
- 0x40,0x00, 0x01,0x00,
- 0x20,0x00, 0x02,0x00,
- 0x10,0x00, 0x04,0x00,
- 0x08,0x00, 0x08,0x00,
- 0x04,0x00, 0x10,0x00,
- 0x02,0x00, 0x20,0x00,
- 0x01,0x00, 0x40,0x00,
- 0x00,0x80, 0x80,0x00,
- 0x00,0x41, 0x00,0x00,
- 0x00,0x22, 0x00,0x00,
- 0x00,0x14, 0x00,0x00,
- 0x00,0x08, 0x00,0x00,
- 0x00,0x14, 0x00,0x00,
- 0x00,0x22, 0x00,0x00,
- 0x00,0x41, 0x00,0x00,
- 0x00,0x80, 0x80,0x00,
- 0x01,0x00, 0x40,0x00,
- 0x02,0x00, 0x20,0x00,
- 0x04,0x00, 0x10,0x00,
- 0x08,0x00, 0x08,0x00,
- 0x10,0x00, 0x04,0x00,
- 0x20,0x00, 0x02,0x00,
- 0x40,0x00, 0x01,0x00,
- 0x80,0x00, 0x00,0x80,/* CROSS 25x25 = 5.5 */
-
- 0x80,0x00, 0x00,0x20,
- 0x40,0x00, 0x00,0x40,
- 0x20,0x00, 0x00,0x80,
- 0x10,0x00, 0x01,0x00,
- 0x08,0x00, 0x02,0x00,
- 0x04,0x00, 0x04,0x00,
- 0x02,0x00, 0x08,0x00,
- 0x01,0x00, 0x10,0x00,
- 0x00,0x80, 0x20,0x00,
- 0x00,0x40, 0x40,0x00,
- 0x00,0x20, 0x80,0x00,
- 0x00,0x11, 0x00,0x00,
- 0x00,0x0a, 0x00,0x00,
- 0x00,0x04, 0x00,0x00,
- 0x00,0x0a, 0x00,0x00,
- 0x00,0x11, 0x00,0x00,
- 0x00,0x20, 0x80,0x00,
- 0x00,0x40, 0x40,0x00,
- 0x00,0x80, 0x20,0x00,
- 0x01,0x00, 0x10,0x00,
- 0x02,0x00, 0x08,0x00,
- 0x04,0x00, 0x04,0x00,
- 0x08,0x00, 0x02,0x00,
- 0x10,0x00, 0x01,0x00,
- 0x20,0x00, 0x00,0x80,
- 0x40,0x00, 0x00,0x40,
- 0x80,0x00, 0x00,0x20,/* CROSS 27x27 = 6.0 */
-
- 0x00,0x00, 0x00,0x00,
- 0x00,0x00, 0x00,0x00,
- 0x20,0x00, 0x00,0x04,
- 0x10,0x00, 0x00,0x08,
- 0x08,0x00, 0x00,0x10,
- 0x04,0x00, 0x00,0x20,
- 0x02,0x00, 0x00,0x40,
- 0x01,0x00, 0x00,0x80,
- 0x00,0x80, 0x01,0x00,
- 0x00,0x40, 0x02,0x00,
- 0x00,0x20, 0x04,0x00,
- 0x00,0x10, 0x08,0x00,
- 0x00,0x08, 0x10,0x00,
- 0x00,0x04, 0x20,0x00,
- 0x00,0x02, 0x40,0x00,
- 0x00,0x01, 0x80,0x00,
- 0x00,0x01, 0x80,0x00,
- 0x00,0x02, 0x40,0x00,
- 0x00,0x04, 0x20,0x00,
- 0x00,0x08, 0x10,0x00,
- 0x00,0x10, 0x08,0x00,
- 0x00,0x20, 0x04,0x00,
- 0x00,0x40, 0x02,0x00,
- 0x00,0x80, 0x01,0x00,
- 0x01,0x00, 0x00,0x80,
- 0x02,0x00, 0x00,0x40,
- 0x04,0x00, 0x00,0x20,
- 0x08,0x00, 0x00,0x10,
- 0x10,0x00, 0x00,0x08,
- 0x20,0x00, 0x00,0x04,
- 0x00,0x00, 0x00,0x00,
- 0x00,0x00, 0x00,0x00,/* CROSS 32x32 = 6.5 */
-
- 0x00,0x00, 0x00,0x00,
- 0x40,0x00, 0x00,0x02,
- 0x20,0x00, 0x00,0x04,
- 0x10,0x00, 0x00,0x08,
- 0x08,0x00, 0x00,0x10,
- 0x04,0x00, 0x00,0x20,
- 0x02,0x00, 0x00,0x40,
- 0x01,0x00, 0x00,0x80,
- 0x00,0x80, 0x01,0x00,
- 0x00,0x40, 0x02,0x00,
- 0x00,0x20, 0x04,0x00,
- 0x00,0x10, 0x08,0x00,
- 0x00,0x08, 0x10,0x00,
- 0x00,0x04, 0x20,0x00,
- 0x00,0x02, 0x40,0x00,
- 0x00,0x01, 0x80,0x00,
- 0x00,0x01, 0x80,0x00,
- 0x00,0x02, 0x40,0x00,
- 0x00,0x04, 0x20,0x00,
- 0x00,0x08, 0x10,0x00,
- 0x00,0x10, 0x08,0x00,
- 0x00,0x20, 0x04,0x00,
- 0x00,0x40, 0x02,0x00,
- 0x00,0x80, 0x01,0x00,
- 0x01,0x00, 0x00,0x80,
- 0x02,0x00, 0x00,0x40,
- 0x04,0x00, 0x00,0x20,
- 0x08,0x00, 0x00,0x10,
- 0x10,0x00, 0x00,0x08,
- 0x20,0x00, 0x00,0x04,
- 0x40,0x00, 0x00,0x02,
- 0x00,0x00, 0x00,0x00/* CROSS 32x32 = 7.0 */
-};
-
/*----------------------------------------------------------------------*/
//TsmInitAttributes
}
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- myMarkerBase = glGenLists (60);
- int j;
- for( i = 1; i < TEL_NB_OF_LISTS; i++ )
- for( j = 0; j < TEL_NO_OF_SIZES; j++ )
- {
- const Tfloat w = arrPMFontInfo[i][j].width;
- const Tfloat h = arrPMFontInfo[i][j].height;
- const Tint offset = arrPMFontInfo[i][j].offset;
-
- glNewList( (const GLuint)(arrPMFontInfo[i][j].str[0] + myMarkerBase), GL_COMPILE );
- glBitmap( (GLsizei)w, (GLsizei)h, (GLfloat)(0.5f * w), (GLfloat)(0.5f * h), 0.f, 0.f, (const GLubyte *) &myMarkerRaster[offset] );
- glEndList();
- }
-}
-
-/*----------------------------------------------------------------------*/
-
-#define TEL_PM_START_SIZE 1.F
-#define TEL_PM_END_SIZE 7.F
-
-//TelGetStringForPM
-const char * OpenGl_Display::GetStringForMarker (const Aspect_TypeOfMarker AType, const Tfloat AVal) const
-{
- const int atype = (int)(( AType > Aspect_TOM_O_X )? Aspect_TOM_X : AType);
-
- const float index = ( float )(TEL_NO_OF_SIZES-1) * (AVal - ( float )TEL_PM_START_SIZE ) / ( float )(TEL_PM_END_SIZE - TEL_PM_START_SIZE);
- int id = (int)(index + 0.5F);
- if (id < 0) id = 0;
- else if (id >= TEL_NO_OF_SIZES) id = TEL_NO_OF_SIZES-1;
-
- return arrPMFontInfo[atype][id].str;
-}
-
-/*----------------------------------------------------------------------*/
-
-void OpenGl_Display::SetBaseForMarker () const
-{
- glListBase( (const GLuint) myMarkerBase );
}
/*----------------------------------------------------------------------*/
Standard_EXPORT void ViewMapping (const Graphic3d_CView& ACView, const Standard_Boolean AWait);
Standard_EXPORT void ViewOrientation (const Graphic3d_CView& ACView,const Standard_Boolean AWait);
Standard_EXPORT void Environment (const Graphic3d_CView& ACView);
- Standard_EXPORT void Marker (const Graphic3d_CGroup& ACGroup, const Graphic3d_Vertex& APoint);
- Standard_EXPORT void MarkerSet (const Graphic3d_CGroup& ACGroup, const Graphic3d_Array1OfVertex& ListVertex);
Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax = Standard_True);
Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const TCollection_ExtendedString& AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
{
if (!theCGroup.ContextMarker.IsDef || theCGroup.ptrGroup == NULL) return;
- ((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectMarker (theCGroup.ContextMarker, theNoInsert);
+ ((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectMarker (GetSharedContext(), theCGroup.ContextMarker, theNoInsert);
}
void OpenGl_GraphicDriver::MarkerContextGroup (const Graphic3d_CGroup& theCGroup,
const Standard_Integer theMarkHeight,
const Handle(TColStd_HArray1OfByte)& theTexture)
{
- if(!theCGroup.ContextMarker.IsDef)
+ if (!theCGroup.ContextMarker.IsDef)
+ {
return;
-
- if (!openglDisplay.IsNull())
- openglDisplay->AddUserMarker ((int )theCGroup.ContextMarker.Scale, theMarkWidth, theMarkHeight, theTexture);
+ }
if (theCGroup.ptrGroup != NULL)
{
- ((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectMarker (theCGroup.ContextMarker, theNoInsert);
+ ((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectMarker (GetSharedContext(), theCGroup.ContextMarker, theNoInsert);
}
}
aStructure->SetAspectFace (GetSharedContext(), theCStructure.ContextFillArea);
if (theCStructure.ContextMarker.IsDef)
- aStructure->SetAspectMarker (theCStructure.ContextMarker);
+ aStructure->SetAspectMarker (GetSharedContext(), theCStructure.ContextMarker);
if (theCStructure.ContextText.IsDef)
aStructure->SetAspectText (theCStructure.ContextText);
+++ /dev/null
-// Created on: 2011-10-20
-// Created by: Sergey ZERCHANINOV
-// Copyright (c) 2011-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 <OpenGl_GraphicDriver.hxx>
-
-#include <Aspect_TypeOfMarker.hxx>
-#include <OpenGl_Group.hxx>
-#include <OpenGl_MarkerSet.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
-
-static void OpenGl_CreateMarkers(const Graphic3d_CGroup& ACGroup, const Standard_Integer NbPoints, const Graphic3d_Vertex *Points)
-{
- OpenGl_MarkerSet *amarkerset = new OpenGl_MarkerSet( NbPoints, Points );
- ((OpenGl_Group *)ACGroup.ptrGroup)->AddElement( TelMarkerSet, amarkerset );
-}
-
-void OpenGl_GraphicDriver::Marker (const Graphic3d_CGroup& ACGroup, const Graphic3d_Vertex &APoint)
-{
- if (!ACGroup.ptrGroup)
- return;
-
- const Aspect_TypeOfMarker AType = Aspect_TypeOfMarker (ACGroup.ContextMarker.MarkerType);
-
- switch (AType)
- {
- case Aspect_TOM_POINT :
- case Aspect_TOM_PLUS :
- case Aspect_TOM_STAR :
- case Aspect_TOM_O :
- case Aspect_TOM_X :
- case Aspect_TOM_O_POINT :
- case Aspect_TOM_O_PLUS :
- case Aspect_TOM_O_STAR :
- case Aspect_TOM_O_X :
- case Aspect_TOM_RING1 :
- case Aspect_TOM_RING2 :
- case Aspect_TOM_RING3 :
- case Aspect_TOM_USERDEFINED:
- OpenGl_CreateMarkers(ACGroup, 1, &APoint);
- break;
-
- case Aspect_TOM_BALL :
- {
- const Standard_Real Delta = 0.1;
-
- Standard_Real R, G, B, H, L, S, AScale;
- R = Standard_Real (ACGroup.ContextMarker.Color.r);
- G = Standard_Real (ACGroup.ContextMarker.Color.g);
- B = Standard_Real (ACGroup.ContextMarker.Color.b);
- AScale = Standard_Real (ACGroup.ContextMarker.Scale);
-
- // we draw a set of circles
- CALL_DEF_CONTEXTMARKER AContext;
- AContext.MarkerType = int (Aspect_TOM_O);
- while (AScale >= 1.0)
- {
- Quantity_Color::RgbHls (R, G, B, H, L, S);
- // Modification de la saturation de 5 %
- S *= 0.95;
- Quantity_Color::HlsRgb (H, L, S, R, G, B);
- AContext.Color.r = float (R);
- AContext.Color.g = float (G);
- AContext.Color.b = float (B);
- AContext.Scale = float (AScale);
- ((OpenGl_Group *)ACGroup.ptrGroup)->SetAspectMarker(AContext, Standard_False);
- OpenGl_CreateMarkers(ACGroup, 1, &APoint);
- AScale -= Delta;
- }
- break;
- }
- default:
- break;
- }
-}
-
-void OpenGl_GraphicDriver::MarkerSet (const Graphic3d_CGroup& ACGroup,
- const Graphic3d_Array1OfVertex& ListVertex)
-{
- if (!ACGroup.ptrGroup)
- return;
-
- const Standard_Integer nb = ListVertex.Length();
- const Graphic3d_Vertex *arr = &ListVertex( ListVertex.Lower() );
-
- const Aspect_TypeOfMarker AType = Aspect_TypeOfMarker (ACGroup.ContextMarker.MarkerType);
-
- switch (AType)
- {
- case Aspect_TOM_POINT :
- case Aspect_TOM_PLUS :
- case Aspect_TOM_STAR :
- case Aspect_TOM_O :
- case Aspect_TOM_X :
- case Aspect_TOM_O_POINT :
- case Aspect_TOM_O_PLUS :
- case Aspect_TOM_O_STAR :
- case Aspect_TOM_O_X :
- case Aspect_TOM_RING1 :
- case Aspect_TOM_RING2 :
- case Aspect_TOM_RING3 :
- case Aspect_TOM_USERDEFINED:
- OpenGl_CreateMarkers(ACGroup, nb, arr);
- break;
-
- case Aspect_TOM_BALL :
- {
- const Standard_Real Delta = 0.1;
-
- Standard_Real R, G, B, H, L, S, AScale;
- R = Standard_Real (ACGroup.ContextMarker.Color.r);
- G = Standard_Real (ACGroup.ContextMarker.Color.g);
- B = Standard_Real (ACGroup.ContextMarker.Color.b);
- AScale = Standard_Real (ACGroup.ContextMarker.Scale);
-
- // we draw a set of circles
- CALL_DEF_CONTEXTMARKER AContext;
- AContext.MarkerType = int (Aspect_TOM_O);
- while (AScale >= 1.0)
- {
- Quantity_Color::RgbHls (R, G, B, H, L, S);
- // Modification de la saturation de 5 %
- S *= 0.95;
- Quantity_Color::HlsRgb (H, L, S, R, G, B);
- AContext.Color.r = float (R);
- AContext.Color.g = float (G);
- AContext.Color.b = float (B);
- AContext.Scale = float (AScale);
- ((OpenGl_Group *)ACGroup.ptrGroup)->SetAspectMarker(AContext, Standard_False);
- OpenGl_CreateMarkers(ACGroup, nb, arr);
- AScale -= Delta;
- }
- break;
- }
- default:
- break;
- }
-}
/*----------------------------------------------------------------------*/
-void OpenGl_Group::SetAspectMarker (const CALL_DEF_CONTEXTMARKER& theContext,
+void OpenGl_Group::SetAspectMarker (const Handle(OpenGl_Context)& theCtx,
+ const CALL_DEF_CONTEXTMARKER& theAspect,
const Standard_Boolean theIsGlobal)
{
if (theIsGlobal || myFirst == NULL)
{
if (myAspectMarker == NULL)
+ {
myAspectMarker = new OpenGl_AspectMarker();
- myAspectMarker->SetContext (theContext);
+ }
+ myAspectMarker->Init (theCtx, theAspect);
}
else
{
OpenGl_AspectMarker* anAspectMarker = new OpenGl_AspectMarker();
- anAspectMarker->SetContext (theContext);
+ anAspectMarker->Init (theCtx, theAspect);
AddElement (TelNil/*TelAspectMarker*/, anAspectMarker);
}
}
void SetAspectFace (const Handle(OpenGl_Context)& theCtx,
const CALL_DEF_CONTEXTFILLAREA& theAspect,
const Standard_Boolean IsGlobal = Standard_True);
- void SetAspectMarker (const CALL_DEF_CONTEXTMARKER &AContext, const Standard_Boolean IsGlobal = Standard_True);
+ void SetAspectMarker (const Handle(OpenGl_Context)& theCtx,
+ const CALL_DEF_CONTEXTMARKER& theAspect,
+ const Standard_Boolean IsGlobal = Standard_True);
void SetAspectText (const CALL_DEF_CONTEXTTEXT &AContext, const Standard_Boolean IsGlobal = Standard_True);
void AddElement (const TelType, OpenGl_Element * );
+++ /dev/null
-// Created on: 2011-07-13
-// Created by: Sergey ZERCHANINOV
-// Copyright (c) 2011-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 <OpenGl_GlCore11.hxx>
-#include <OpenGl_Context.hxx>
-
-#include <OpenGl_Marker.hxx>
-
-#include <OpenGl_AspectMarker.hxx>
-#include <OpenGl_Structure.hxx>
-#include <OpenGl_Display.hxx>
-#include <OpenGl_Workspace.hxx>
-
-/*----------------------------------------------------------------------*/
-
-void OpenGl_Marker::Release (const Handle(OpenGl_Context)&)
-{
- //
-}
-
-void OpenGl_Marker::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
-{
- const OpenGl_AspectMarker *aspect_marker = AWorkspace->AspectMarker( Standard_True );
-
- // Use highlight colours
- glColor3fv( (AWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT)? AWorkspace->HighlightColor->rgb : aspect_marker->Color().rgb );
-
- switch ( aspect_marker->Type() )
- {
- case Aspect_TOM_O_POINT :
- {
- const char *str = AWorkspace->GetDisplay()->GetStringForMarker( Aspect_TOM_O, aspect_marker->Scale() );
- glRasterPos3fv( myPoint.xyz );
- AWorkspace->GetDisplay()->SetBaseForMarker();
- glCallLists( strlen( str ), GL_UNSIGNED_BYTE, (const GLubyte *) str );
- }
- case Aspect_TOM_POINT :
- {
- glBegin( GL_POINTS );
- glVertex3fv( myPoint.xyz );
- glEnd();
- break;
- }
- default:
- {
- glRasterPos3fv( myPoint.xyz );
- switch ( aspect_marker->Type() )
- {
- case Aspect_TOM_RING1 :
- case Aspect_TOM_RING2 :
- case Aspect_TOM_RING3 :
- {
- const float ADelta = 0.1f;
- float AScale = aspect_marker->Scale();
- float ALimit = 0.f;
- if (aspect_marker->Type() == Aspect_TOM_RING1)
- ALimit = AScale * 0.2f;
- else if (aspect_marker->Type() == Aspect_TOM_RING2)
- ALimit = AScale * 0.5f;
- else
- ALimit = AScale * 0.8f;
- AWorkspace->GetDisplay()->SetBaseForMarker();
- while (AScale > ALimit && AScale >= 1.f)
- {
- const char *str = AWorkspace->GetDisplay()->GetStringForMarker( Aspect_TOM_O, AScale );
- glCallLists( strlen( str ), GL_UNSIGNED_BYTE, (const GLubyte *) str );
- AScale -= ADelta;
- }
- break;
- }
- case Aspect_TOM_USERDEFINED :
- {
- glCallList( openglDisplay->GetUserMarkerListIndex( (int)aspect_marker->Scale() ) );
- break;
- }
- default :
- {
- AWorkspace->GetDisplay()->SetBaseForMarker();
- const char *str = AWorkspace->GetDisplay()->GetStringForMarker( aspect_marker->Type(), aspect_marker->Scale() );
- glCallLists( strlen( str ), GL_UNSIGNED_BYTE, (const GLubyte *)str );
- }
- }
-
- if (AWorkspace->GetGlContext()->IsFeedback())
- {
- glBegin( GL_POINTS );
- glVertex3fv( myPoint.xyz );
- glEnd();
- /* it is necessary to indicate end of marker information*/
- }
- }
- }
-}
-
-/*----------------------------------------------------------------------*/
+++ /dev/null
-// Created on: 2011-07-13
-// Created by: Sergey ZERCHANINOV
-// Copyright (c) 2011-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.
-
-
-#ifndef OpenGl_Marker_Header
-#define OpenGl_Marker_Header
-
-#include <InterfaceGraphic_telem.hxx>
-
-#include <OpenGl_Element.hxx>
-
-class OpenGl_Marker : public OpenGl_Element
-{
- public:
-
- OpenGl_Marker (const TEL_POINT &APoint) : myPoint(APoint) {}
-
- virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
- virtual void Release (const Handle(OpenGl_Context)& theContext);
-
- protected:
-
- TEL_POINT myPoint;
-
- public:
- DEFINE_STANDARD_ALLOC
-};
-
-#endif //OpenGl_Marker_Header
+++ /dev/null
-// Created on: 2011-07-13
-// Created by: Sergey ZERCHANINOV
-// Copyright (c) 2011-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 <OpenGl_GlCore11.hxx>
-#include <OpenGl_Context.hxx>
-
-#include <OpenGl_MarkerSet.hxx>
-
-#include <OpenGl_AspectMarker.hxx>
-#include <OpenGl_Structure.hxx>
-#include <OpenGl_Display.hxx>
-#include <OpenGl_Workspace.hxx>
-
-/*----------------------------------------------------------------------*/
-
-OpenGl_MarkerSet::OpenGl_MarkerSet (const Standard_Integer ANbPoints, const Graphic3d_Vertex *APoints)
-: myNbPoints(ANbPoints),
- myPoints(new TEL_POINT[ANbPoints])
-{
- memcpy( myPoints, APoints, ANbPoints*sizeof(TEL_POINT) );
-}
-
-/*----------------------------------------------------------------------*/
-
-OpenGl_MarkerSet::~OpenGl_MarkerSet ()
-{
- if (myPoints)
- delete[] myPoints;
-}
-
-/*----------------------------------------------------------------------*/
-
-void OpenGl_MarkerSet::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
-{
- const OpenGl_AspectMarker *aspect_marker = AWorkspace->AspectMarker( Standard_True );
-
- // Use highlight colors
- glColor3fv( (AWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT)? AWorkspace->HighlightColor->rgb : aspect_marker->Color().rgb );
-
- const TEL_POINT *ptr;
- Tint i;
-
- switch ( aspect_marker->Type() )
- {
- case Aspect_TOM_O_POINT :
- {
- const char *str = AWorkspace->GetDisplay()->GetStringForMarker( Aspect_TOM_O, aspect_marker->Scale() );
- AWorkspace->GetDisplay()->SetBaseForMarker();
- for( i = 0, ptr = myPoints; i < myNbPoints; i++, ptr++ )
- {
- glRasterPos3fv( ptr->xyz );
- glCallLists( strlen( str ), GL_UNSIGNED_BYTE, (const GLubyte *) str );
- }
- }
- case Aspect_TOM_POINT :
- {
- glBegin( GL_POINTS );
- for( i = 0, ptr = myPoints; i < myNbPoints; i++, ptr++ )
- glVertex3fv( ptr->xyz );
- glEnd();
- break;
- }
- default:
- {
- switch ( aspect_marker->Type() )
- {
- case Aspect_TOM_RING1 :
- case Aspect_TOM_RING2 :
- case Aspect_TOM_RING3 :
- {
- const float ADelta = 0.1f;
- float AScale = aspect_marker->Scale();
- float ALimit = 0.f;
- if (aspect_marker->Type() == Aspect_TOM_RING1)
- ALimit = AScale * 0.2f;
- else if (aspect_marker->Type() == Aspect_TOM_RING2)
- ALimit = AScale * 0.5f;
- else
- ALimit = AScale * 0.8f;
- AWorkspace->GetDisplay()->SetBaseForMarker();
- for( i = 0, ptr = myPoints; i < myNbPoints; i++, ptr++ )
- {
- glRasterPos3fv( ptr->xyz );
- AScale = aspect_marker->Scale();
- while (AScale > ALimit && AScale >= 1.f)
- {
- const char *str = AWorkspace->GetDisplay()->GetStringForMarker( Aspect_TOM_O, AScale );
- glCallLists( strlen( str ), GL_UNSIGNED_BYTE, (const GLubyte *) str );
- AScale -= ADelta;
- }
- }
- break;
- }
- case Aspect_TOM_USERDEFINED :
- {
- for( i = 0, ptr = myPoints; i < myNbPoints; i++, ptr++ )
- {
- glRasterPos3fv( ptr->xyz );
- glCallList( openglDisplay->GetUserMarkerListIndex( (int)aspect_marker->Scale() ) );
- }
- break;
- }
- default :
- {
- AWorkspace->GetDisplay()->SetBaseForMarker();
- const char *str = AWorkspace->GetDisplay()->GetStringForMarker( aspect_marker->Type(), aspect_marker->Scale() );
- for( i = 0, ptr = myPoints; i < myNbPoints; i++, ptr++ )
- {
- glRasterPos3fv( ptr->xyz );
- glCallLists( strlen( str ), GL_UNSIGNED_BYTE, (const GLubyte *) str );
- }
- }
- }
-
- if (AWorkspace->GetGlContext()->IsFeedback())
- {
- glBegin( GL_POINTS );
- for( i = 0, ptr = myPoints; i < myNbPoints; i++, ptr++ )
- glVertex3fv( ptr->xyz );
- glEnd();
- }
- }
- }
-}
-
-void OpenGl_MarkerSet::Release (const Handle(OpenGl_Context)&)
-{
- //
-}
+++ /dev/null
-// Created on: 2011-07-13
-// Created by: Sergey ZERCHANINOV
-// Copyright (c) 2011-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.
-
-
-#ifndef OpenGl_MarkerSet_Header
-#define OpenGl_MarkerSet_Header
-
-#include <InterfaceGraphic_telem.hxx>
-
-#include <OpenGl_Element.hxx>
-
-#include <Graphic3d_Vertex.hxx>
-
-class OpenGl_MarkerSet : public OpenGl_Element
-{
-
-public:
-
- OpenGl_MarkerSet (const Standard_Integer ANbPoints, const Graphic3d_Vertex *APoints);
-
- virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
- virtual void Release (const Handle(OpenGl_Context)& theContext);
-
-protected:
-
- virtual ~OpenGl_MarkerSet();
-
-protected:
-
- Tint myNbPoints;
- TEL_POINT* myPoints;
-
-public:
-
- DEFINE_STANDARD_ALLOC
-
-};
-
-#endif //OpenGl_MarkerSet_Header
--- /dev/null
+// Created by: Kirill GAVRILOV
+// Copyright (c) 2013 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 <OpenGl_PointSprite.hxx>
+
+#include <Graphic3d_TextureParams.hxx>
+#include <OpenGl_Context.hxx>
+#include <Standard_Assert.hxx>
+#include <Image_PixMap.hxx>
+
+IMPLEMENT_STANDARD_HANDLE (OpenGl_PointSprite, OpenGl_Texture)
+IMPLEMENT_STANDARD_RTTIEXT(OpenGl_PointSprite, OpenGl_Texture)
+
+// =======================================================================
+// function : OpenGl_PointSprite
+// purpose :
+// =======================================================================
+OpenGl_PointSprite::OpenGl_PointSprite()
+: OpenGl_Texture (NULL),
+ myBitmapList (0)
+{
+ //myParams->SetFilter (Graphic3d_TOTF_NEAREST);
+ myParams->SetGenMode (Graphic3d_TOTM_SPRITE,
+ Graphic3d_Vec4 (0.0f, 0.0f, 0.0f, 0.0f),
+ Graphic3d_Vec4 (0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+// =======================================================================
+// function : ~OpenGl_PointSprite
+// purpose :
+// =======================================================================
+OpenGl_PointSprite::~OpenGl_PointSprite()
+{
+ Release (NULL);
+}
+
+// =======================================================================
+// function : Release
+// purpose :
+// =======================================================================
+void OpenGl_PointSprite::Release (const OpenGl_Context* theGlCtx)
+{
+ if (myBitmapList != 0)
+ {
+ glDeleteLists (myBitmapList, 1);
+ myBitmapList = 0;
+ }
+
+ OpenGl_Texture::Release (theGlCtx);
+}
+
+// =======================================================================
+// function : SetDisplayList
+// purpose :
+// =======================================================================
+void OpenGl_PointSprite::SetDisplayList (const Handle(OpenGl_Context)& theCtx,
+ const GLuint theBitmapList)
+{
+ Release (theCtx.operator->());
+ myBitmapList = theBitmapList;
+}
+
+
+// =======================================================================
+// function : DrawBitmap
+// purpose :
+// =======================================================================
+void OpenGl_PointSprite::DrawBitmap (const Handle(OpenGl_Context)& ) const
+{
+ if (myBitmapList != 0)
+ {
+ glCallList (myBitmapList);
+ }
+}
--- /dev/null
+// Created by: Kirill GAVRILOV
+// Copyright (c) 2013 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.
+
+#ifndef _OpenGl_PointSprite_H__
+#define _OpenGl_PointSprite_H__
+
+#include <OpenGl_Texture.hxx>
+#include <Handle_OpenGl_PointSprite.hxx>
+
+//! Point sprite resource. On modern hardware it will be texture with extra parameters.
+//! On ancient hardware sprites will be drawn using bitmaps.
+class OpenGl_PointSprite : public OpenGl_Texture
+{
+
+public:
+
+ //! Create uninitialized resource.
+ Standard_EXPORT OpenGl_PointSprite();
+
+ //! Destroy object.
+ Standard_EXPORT virtual ~OpenGl_PointSprite();
+
+ //! Destroy object - will release GPU memory if any.
+ Standard_EXPORT virtual void Release (const OpenGl_Context* theCtx);
+
+ //! @return true if this is display list bitmap
+ inline Standard_Boolean IsDisplayList() const
+ {
+ return myBitmapList != 0;
+ }
+
+ //! Draw sprite using glBitmap.
+ //! Please call glRasterPos3fv() before to setup sprite position.
+ Standard_EXPORT void DrawBitmap (const Handle(OpenGl_Context)& theCtx) const;
+
+ //! Initialize point sprite as display list
+ Standard_EXPORT void SetDisplayList (const Handle(OpenGl_Context)& theCtx,
+ const GLuint theBitmapList);
+
+protected:
+
+ GLuint myBitmapList; //!< if of display list to draw sprite using glBitmap (for backward compatibility)
+
+public:
+
+ DEFINE_STANDARD_RTTI(OpenGl_PointSprite) // Type definition
+
+};
+
+#endif // _OpenGl_PointSprite_H__
#include <OpenGl_AspectFace.hxx>
#include <OpenGl_GraphicDriver.hxx>
+#include <OpenGl_PointSprite.hxx>
#include <OpenGl_Structure.hxx>
#include <OpenGl_Workspace.hxx>
glEnableClientState (GL_TEXTURE_COORD_ARRAY);
}
- if (pvc != NULL)
+ if ((pvc != NULL) && (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) == 0)
{
glColorPointer (4, GL_UNSIGNED_BYTE, 0, pvc); // array of colors
glEnableClientState (GL_COLOR_ARRAY);
{
myVbos[VBOVtexels]->BindFixed (aGlContext, GL_TEXTURE_COORD_ARRAY);
}
- if (!myVbos[VBOVcolours].IsNull())
+ if (!myVbos[VBOVcolours].IsNull() && (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) == 0)
{
myVbos[VBOVcolours]->BindFixed (aGlContext, GL_COLOR_ARRAY);
glColorMaterial (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
}
else
{
- glDrawArrays (myDrawMode, 0, myVbos[VBOVertices]->GetElemsNb());
+ if (myDrawMode == GL_POINTS)
+ {
+ DrawMarkers (theWorkspace);
+ }
+ else
+ {
+ glDrawArrays (myDrawMode, 0, myVbos[VBOVertices]->GetElemsNb());
+ }
}
// bind with 0
}
else
{
- glDrawArrays (myDrawMode, 0, myPArray->num_vertexs);
+ if (myDrawMode == GL_POINTS)
+ {
+ DrawMarkers (theWorkspace);
+ }
+ else
+ {
+ glDrawArrays (myDrawMode, 0, myPArray->num_vertexs);
+ }
}
if (pvc != NULL)
}
}
+// =======================================================================
+// function : DrawMarkers
+// purpose :
+// =======================================================================
+void OpenGl_PrimitiveArray::DrawMarkers (const Handle(OpenGl_Workspace)& theWorkspace) const
+{
+ const OpenGl_AspectMarker* anAspectMarker = theWorkspace->AspectMarker (Standard_True);
+ const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
+ const Handle(OpenGl_PointSprite)& aSpriteNorm = anAspectMarker->Sprite();
+ const Standard_Boolean isHilight = (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT);
+ if (aCtx->IsGlGreaterEqual (2, 0)
+ && !aSpriteNorm.IsNull() && !aSpriteNorm->IsDisplayList())
+ {
+ // Textured markers will be drawn with the point sprites
+ glPointSize (anAspectMarker->MarkerSize());
+
+ Handle(OpenGl_Texture) aTextureBack;
+ if (anAspectMarker->Type() != Aspect_TOM_POINT)
+ {
+ const Handle(OpenGl_PointSprite)& aSprite = (isHilight && anAspectMarker->SpriteHighlight()->IsValid())
+ ? anAspectMarker->SpriteHighlight()
+ : aSpriteNorm;
+ aTextureBack = theWorkspace->EnableTexture (aSprite);
+
+ glEnable (GL_ALPHA_TEST);
+ glAlphaFunc (GL_GEQUAL, 0.1f);
+
+ glEnable (GL_BLEND);
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ }
+
+ glDrawArrays (myDrawMode, 0, toDrawVbo() ? myVbos[VBOVertices]->GetElemsNb() : myPArray->num_vertexs);
+
+ glDisable (GL_BLEND);
+ glDisable (GL_ALPHA_TEST);
+ if (anAspectMarker->Type() != Aspect_TOM_POINT)
+ {
+ theWorkspace->EnableTexture (aTextureBack);
+ }
+ glPointSize (1.0f);
+ return;
+ }
+
+ // Textured markers will be drawn with the glBitmap
+ const GLfloat aPntSize = anAspectMarker->Type() == Aspect_TOM_POINT
+ ? anAspectMarker->MarkerSize()
+ : 0.0f;
+ if (aPntSize > 0.0f)
+ {
+ glPointSize (aPntSize);
+ }
+ if (anAspectMarker->Type() == Aspect_TOM_POINT
+ || anAspectMarker->Type() == Aspect_TOM_O_POINT)
+ {
+ glDrawArrays (myDrawMode, 0, toDrawVbo() ? myVbos[VBOVertices]->GetElemsNb() : myPArray->num_vertexs);
+ }
+ if (aPntSize > 0.0f)
+ {
+ glPointSize (1.0f);
+ }
+
+ if (anAspectMarker->Type() != Aspect_TOM_POINT
+ && !aSpriteNorm.IsNull())
+ {
+ if (!isHilight && (myPArray->vcolours != NULL))
+ {
+ for (Standard_Integer anIter = 0; anIter < myPArray->num_vertexs; anIter++)
+ {
+ glColor4ubv ((GLubyte* )&myPArray->vcolours[anIter]);
+ glRasterPos3fv (myPArray->vertices[anIter].xyz);
+ aSpriteNorm->DrawBitmap (theWorkspace->GetGlContext());
+ }
+ }
+ else
+ {
+ for (Standard_Integer anIter = 0; anIter < myPArray->num_vertexs; anIter++)
+ {
+ glRasterPos3fv (myPArray->vertices[anIter].xyz);
+ aSpriteNorm->DrawBitmap (theWorkspace->GetGlContext());
+ }
+ }
+ }
+}
+
// =======================================================================
// function : OpenGl_PrimitiveArray
// purpose :
return;
}
+ const OpenGl_AspectFace* anAspectFace = theWorkspace->AspectFace (Standard_True);
+ const OpenGl_AspectLine* anAspectLine = theWorkspace->AspectLine (Standard_True);
+ const OpenGl_AspectMarker* anAspectMarker = theWorkspace->AspectMarker (myDrawMode == GL_POINTS);
+
// create VBOs on first render call
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
- if (!myIsVboInit && !aCtx->caps->vboDisable && aCtx->core15 != NULL)
+ if (!myIsVboInit
+ && !aCtx->caps->vboDisable
+ && aCtx->core15 != NULL
+ && (myDrawMode != GL_POINTS || anAspectMarker->Sprite().IsNull() || !anAspectMarker->Sprite()->IsDisplayList()))
{
BuildVBO (theWorkspace);
myIsVboInit = Standard_True;
break;
}
- const OpenGl_AspectFace* anAspectFace = theWorkspace->AspectFace (Standard_True);
- const OpenGl_AspectLine* anAspectLine = theWorkspace->AspectLine (Standard_True);
- const OpenGl_AspectMarker* anAspectMarker = theWorkspace->AspectMarker (myPArray->type == TelPointsArrayType);
-
Tint aFrontLightingModel = anAspectFace->IntFront.color_mask;
const TEL_COLOUR* anInteriorColor = &anAspectFace->IntFront.matcol;
const TEL_COLOUR* anEdgeColor = &anAspectFace->AspectEdge()->Color();
#include <InterfaceGraphic_Graphic3d.hxx>
#include <Aspect_InteriorStyle.hxx>
+#include <Aspect_TypeOfMarker.hxx>
#include <OpenGl_Element.hxx>
void DrawEdges (const TEL_COLOUR* theEdgeColour,
const Handle(OpenGl_Workspace)& theWorkspace) const;
+ void DrawMarkers (const Handle(OpenGl_Workspace)& theWorkspace) const;
+
protected:
//! Destructor
/*----------------------------------------------------------------------*/
-void OpenGl_Structure::SetAspectMarker (const CALL_DEF_CONTEXTMARKER &AContext)
+void OpenGl_Structure::SetAspectMarker (const Handle(OpenGl_Context)& theCtx,
+ const CALL_DEF_CONTEXTMARKER& theAspect)
{
if (!myAspectMarker)
+ {
myAspectMarker = new OpenGl_AspectMarker();
- myAspectMarker->SetContext( AContext );
+ }
+ myAspectMarker->Init (theCtx, theAspect);
}
/*----------------------------------------------------------------------*/
void SetAspectLine (const CALL_DEF_CONTEXTLINE &AContext);
void SetAspectFace (const Handle(OpenGl_Context)& theCtx,
const CALL_DEF_CONTEXTFILLAREA& theAspect);
- void SetAspectMarker (const CALL_DEF_CONTEXTMARKER &AContext);
+ void SetAspectMarker (const Handle(OpenGl_Context)& theCtx,
+ const CALL_DEF_CONTEXTMARKER& theAspect);
void SetAspectText (const CALL_DEF_CONTEXTTEXT &AContext);
void SetHighlightBox (const Handle(OpenGl_Context)& theGlCtx,
return false;
}
- GLenum aTextureFormat = GL_RGBA8;
- GLenum aPixelFormat = 0;
- GLenum aDataType = 0;
+ myTextFormat = GL_RGBA8;
+ GLenum aPixelFormat = 0;
+ GLenum aDataType = 0;
switch (theImage.Format())
{
case Image_PixMap::ImgGrayF:
{
- aTextureFormat = GL_ALPHA8; // GL_R8, GL_R32F
- aPixelFormat = GL_ALPHA; // GL_RED
- aDataType = GL_FLOAT;
+ myTextFormat = GL_ALPHA8; // GL_R8, GL_R32F
+ aPixelFormat = GL_ALPHA; // GL_RED
+ aDataType = GL_FLOAT;
break;
}
case Image_PixMap::ImgRGBAF:
{
- aTextureFormat = GL_RGBA8; // GL_RGBA32F
- aPixelFormat = GL_RGBA;
- aDataType = GL_FLOAT;
+ myTextFormat = GL_RGBA8; // GL_RGBA32F
+ aPixelFormat = GL_RGBA;
+ aDataType = GL_FLOAT;
break;
}
case Image_PixMap::ImgBGRAF:
{
return false;
}
- aTextureFormat = GL_RGBA8; // GL_RGBA32F
- aPixelFormat = GL_BGRA; // equals to GL_BGRA_EXT
- aDataType = GL_FLOAT;
+ myTextFormat = GL_RGBA8; // GL_RGBA32F
+ aPixelFormat = GL_BGRA; // equals to GL_BGRA_EXT
+ aDataType = GL_FLOAT;
break;
}
case Image_PixMap::ImgRGBF:
{
- aTextureFormat = GL_RGB8; // GL_RGB32F
- aPixelFormat = GL_RGB;
- aDataType = GL_FLOAT;
+ myTextFormat = GL_RGB8; // GL_RGB32F
+ aPixelFormat = GL_RGB;
+ aDataType = GL_FLOAT;
break;
}
case Image_PixMap::ImgBGRF:
{
- aTextureFormat = GL_RGB8; // GL_RGB32F
- aPixelFormat = GL_BGR; // equals to GL_BGR_EXT
- aDataType = GL_FLOAT;
+ myTextFormat = GL_RGB8; // GL_RGB32F
+ aPixelFormat = GL_BGR; // equals to GL_BGR_EXT
+ aDataType = GL_FLOAT;
break;
}
case Image_PixMap::ImgRGBA:
{
- aTextureFormat = GL_RGBA8;
- aPixelFormat = GL_RGBA;
- aDataType = GL_UNSIGNED_BYTE;
+ myTextFormat = GL_RGBA8;
+ aPixelFormat = GL_RGBA;
+ aDataType = GL_UNSIGNED_BYTE;
break;
}
case Image_PixMap::ImgBGRA:
{
return false;
}
- aTextureFormat = GL_RGBA8;
- aPixelFormat = GL_BGRA; // equals to GL_BGRA_EXT
- aDataType = GL_UNSIGNED_BYTE;
+ myTextFormat = GL_RGBA8;
+ aPixelFormat = GL_BGRA; // equals to GL_BGRA_EXT
+ aDataType = GL_UNSIGNED_BYTE;
break;
}
case Image_PixMap::ImgRGB32:
{
- aTextureFormat = GL_RGB8;
- aPixelFormat = GL_RGBA;
- aDataType = GL_UNSIGNED_BYTE;
+ myTextFormat = GL_RGB8;
+ aPixelFormat = GL_RGBA;
+ aDataType = GL_UNSIGNED_BYTE;
break;
}
case Image_PixMap::ImgBGR32:
{
return false;
}
- aTextureFormat = GL_RGB8;
- aPixelFormat = GL_BGRA; // equals to GL_BGRA_EXT
- aDataType = GL_UNSIGNED_BYTE;
+ myTextFormat = GL_RGB8;
+ aPixelFormat = GL_BGRA; // equals to GL_BGRA_EXT
+ aDataType = GL_UNSIGNED_BYTE;
break;
}
case Image_PixMap::ImgRGB:
{
- aTextureFormat = GL_RGB8;
- aPixelFormat = GL_RGB;
- aDataType = GL_UNSIGNED_BYTE;
+ myTextFormat = GL_RGB8;
+ aPixelFormat = GL_RGB;
+ aDataType = GL_UNSIGNED_BYTE;
break;
}
case Image_PixMap::ImgBGR:
{
return false;
}
- aTextureFormat = GL_RGB8;
- aPixelFormat = GL_BGR; // equals to GL_BGR_EXT
- aDataType = GL_UNSIGNED_BYTE;
+ myTextFormat = GL_RGB8;
+ aPixelFormat = GL_BGR; // equals to GL_BGR_EXT
+ aDataType = GL_UNSIGNED_BYTE;
break;
}
case Image_PixMap::ImgGray:
{
- aTextureFormat = GL_ALPHA8; // GL_R8
- aPixelFormat = GL_ALPHA; // GL_RED
- aDataType = GL_UNSIGNED_BYTE;
+ myTextFormat = GL_ALPHA8; // GL_R8
+ aPixelFormat = GL_ALPHA; // GL_RED
+ aDataType = GL_UNSIGNED_BYTE;
break;
}
default:
}
// use proxy to check texture could be created or not
- glTexImage1D (GL_PROXY_TEXTURE_1D, 0, aTextureFormat,
+ glTexImage1D (GL_PROXY_TEXTURE_1D, 0, myTextFormat,
aWidthOut, 0,
aPixelFormat, aDataType, NULL);
glGetTexLevelParameteriv (GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &aTestWidth);
return false;
}
- glTexImage1D (GL_TEXTURE_1D, 0, aTextureFormat,
+ glTexImage1D (GL_TEXTURE_1D, 0, myTextFormat,
aWidthOut, 0,
aPixelFormat, aDataType, aDataPtr);
if (glGetError() != GL_NO_ERROR)
}
// use proxy to check texture could be created or not
- glTexImage2D (GL_PROXY_TEXTURE_2D, 0, aTextureFormat,
+ glTexImage2D (GL_PROXY_TEXTURE_2D, 0, myTextFormat,
aWidthOut, aHeightOut, 0,
aPixelFormat, aDataType, NULL);
glGetTexLevelParameteriv (GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &aTestWidth);
return false;
}
- glTexImage2D (GL_TEXTURE_2D, 0, aTextureFormat,
+ glTexImage2D (GL_TEXTURE_2D, 0, myTextFormat,
aWidthOut, aHeightOut, 0,
aPixelFormat, aDataType, aDataPtr);
if (glGetError() != GL_NO_ERROR)
&& aWidth == aWidthOut && aHeight == aHeightOut)
{
// use proxy to check texture could be created or not
- glTexImage2D (GL_PROXY_TEXTURE_2D, 0, aTextureFormat,
+ glTexImage2D (GL_PROXY_TEXTURE_2D, 0, myTextFormat,
aWidthOut, aHeightOut, 0,
aPixelFormat, aDataType, NULL);
glGetTexLevelParameteriv (GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &aTestWidth);
}
// upload main picture
- glTexImage2D (GL_TEXTURE_2D, 0, aTextureFormat,
+ glTexImage2D (GL_TEXTURE_2D, 0, myTextFormat,
aWidthOut, aHeightOut, 0,
aPixelFormat, aDataType, theImage.Data());
if (glGetError() != GL_NO_ERROR)
}
else
{
- bool isCreated = gluBuild2DMipmaps (GL_TEXTURE_2D, aTextureFormat,
+ bool isCreated = gluBuild2DMipmaps (GL_TEXTURE_2D, myTextFormat,
aWidth, aHeight,
aPixelFormat, aDataType, theImage.Data()) == 0;
if (isCreated)
return myTextureId;
}
+ //! @return texture format
+ inline GLint GetFormat() const
+ {
+ return myTextFormat;
+ }
+
//! Creates Texture id if not yet generated.
//! Data should be initialized by another method.
Standard_EXPORT bool Create (const Handle(OpenGl_Context)& theCtx);
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-#include <OpenGl_GlCore12.hxx>
+#include <OpenGl_GlCore15.hxx>
#include <InterfaceGraphic.hxx>
{
glDisable (GL_TEXTURE_GEN_S);
glDisable (GL_TEXTURE_GEN_T);
+ if (myTextureBound->GetParams()->GenMode() == Graphic3d_TOTM_SPRITE)
+ {
+ glDisable (GL_POINT_SPRITE);
+ }
}
glDisable (GL_TEXTURE_2D);
break;
glPopMatrix();
break;
}
+ case Graphic3d_TOTM_SPRITE:
+ {
+ if (GetGlContext()->core20 != NULL)
+ {
+ glEnable (GL_POINT_SPRITE);
+ glTexEnvi (GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
+ glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ GetGlContext()->core15->glPointParameteri (GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);
+ }
+ break;
+ }
case Graphic3d_TOTM_MANUAL:
default: break;
}
// setup lighting
- glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, aParams->IsModulate() ? GL_MODULATE : GL_DECAL);
+ if (aParams->GenMode() != Graphic3d_TOTM_SPRITE)
+ {
+ glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, aParams->IsModulate() ? GL_MODULATE : GL_DECAL);
+ }
// setup texture filtering and wrapping
//if (theTexture->GetParams() != theParams)
if (myDisplay.IsNull() || myView.IsNull())
return;
- myDisplay->UpdateUserMarkers();
-
// Request reset of material
NamedStatus |= OPENGL_NS_RESMAT;
#define _Prs3d_Point_H__
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Graphic3d_Group.hxx>
#include <Prs3d_Drawer.hxx>
{
Quantity_Length aX,aY,aZ;
PointTool::Coord(thePoint,aX,aY,aZ);
- Graphic3d_Vertex aVertex(aX,aY,aZ);
- theGroup->Marker(aVertex);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (aX, aY, aZ);
+ theGroup->AddPrimitiveArray (anArrayOfPoints);
}
public:
NameOfColor from Quantity,
Color from Quantity,
TypeOfMarker from Aspect,
- HArray1OfByte from TColStd
+ HArray1OfByte from TColStd,
+ MarkerImage_Handle from Graphic3d
is
returns mutable PointAspect from Prs3d;
Create ( AColor : Color from Quantity;
- AnId : Real from Standard;
AWidth : Integer from Standard;
AHeight : Integer from Standard;
ATexture : HArray1OfByte from TColStd)
---Purpose: Returns marker's texture size.
GetTexture (me:mutable)
- returns HArray1OfByte from TColStd;
+ returns MarkerImage_Handle from Graphic3d;
---Level: Public
---Purpose: Returns marker's texture.
---C++: return const &
}
Prs3d_PointAspect::Prs3d_PointAspect (const Quantity_Color &aColor,
- const Standard_Real anId,
const Standard_Integer aWidth,
const Standard_Integer aHeight,
const Handle(TColStd_HArray1OfByte)& aTexture
)
{
myAspect = new Graphic3d_AspectMarker3d
- (Aspect_TOM_USERDEFINED,aColor,anId,aWidth,aHeight,aTexture);
+ (aColor,aWidth,aHeight,aTexture);
}
#ifdef GER61351
myAspect->GetTextureSize( AWidth, AHeight);
}
-const Handle(TColStd_HArray1OfByte)& Prs3d_PointAspect::GetTexture()
+const Handle(Graphic3d_MarkerImage)& Prs3d_PointAspect::GetTexture()
{
- return myAspect->GetTexture();
+ return myAspect->GetMarkerImage();
}
#include <Graphic3d_Group.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <gp_Pnt.hxx>
#include <Poly_Connect.hxx>
#include <Poly_Triangulation.hxx>
aNbVertices = aShapePoints.Length();
if (aNbVertices > 0)
{
- Graphic3d_Array1OfVertex aPointArray (1, aNbVertices);
+ Handle(Graphic3d_ArrayOfPoints) aPointArray = new Graphic3d_ArrayOfPoints (aNbVertices);
for (anI = 1; anI <= aNbVertices; ++anI)
{
- aPointArray.SetValue (anI, Graphic3d_Vertex (aShapePoints.Value (anI).X(),
- aShapePoints.Value (anI).Y(),
- aShapePoints.Value (anI).Z()));
+ aPointArray->AddVertex (aShapePoints.Value (anI));
}
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
aGroup->SetPrimitivesAspect (theDrawer->PointAspect()->Aspect());
- aGroup->MarkerSet (aPointArray);
+ aGroup->AddPrimitiveArray (aPointArray);
}
}
#include <SelectMgr_DataMapIteratorOfDataMapOfSelectionActivation.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <SelectBasics_ListIteratorOfListOfBox2d.hxx>
#include <Poly_Connect.hxx>
#include <TColStd_HArray1OfInteger.hxx>
gp_Pnt P = hasloc ?
Handle(Select3D_SensitivePoint)::DownCast(Ent)->Point() :
Handle(Select3D_SensitivePoint)::DownCast(Ent)->Point().Transformed (theloc.Transformation());
- Graphic3d_Vertex V (P.X(), P.Y(), P.Z());
- mysensgroup->Marker (V);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (P.X(), P.Y(), P.Z());
+ mysensgroup->AddPrimitiveArray (anArrayOfPoints);
}
//============================================================
// Triangulation : On met un petit offset ves l'interieur...
#include <Graphic3d_Vertex.hxx>
#include <Graphic3d_Array1OfVertex.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Visual3d_ViewManager.hxx>
#include <V3d_Viewer.hxx>
{
Standard_Real X,Y,Z;
const Standard_Integer nbv = aSeqPnts.Length();
- Graphic3d_Array1OfVertex Cercle (1,nbv);
+ Handle(Graphic3d_ArrayOfPoints) Cercle = new Graphic3d_ArrayOfPoints (nbv);
for (Standard_Integer i=1; i<=nbv; i++)
{
aSeqPnts(i).Coord(X,Y,Z);
- Cercle(i).SetCoord(X,Y,Z);
+ Cercle->AddVertex (X,Y,Z);
}
- myGroup->MarkerSet (Cercle, Standard_False);
+ myGroup->AddPrimitiveArray (Cercle, Standard_False);
}
myGroup->SetMinMaxValues(-myRadius, -myRadius, 0.0, myRadius, myRadius, 0.0);
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectText3d.hxx>
-#include <Graphic3d_Vertex.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <Visual3d_ViewManager.hxx>
#include <V3d_Viewer.hxx>
#include <TColgp_SequenceOfPnt.hxx>
Standard_Integer i;
Standard_Real X,Y,Z;
const Standard_Integer nbv = aSeqPnts.Length();
- Graphic3d_Array1OfVertex Vertical (1,nbv);
+ Handle(Graphic3d_ArrayOfPoints) Vertical = new Graphic3d_ArrayOfPoints (nbv);
for (i=1; i<=nbv; i++)
{
aSeqPnts(i).Coord(X,Y,Z);
- Vertical(i).SetCoord(X,Y,Z);
+ Vertical->AddVertex (X,Y,Z);
}
myGroup->SetGroupPrimitivesAspect (MarkerAttrib);
- myGroup->MarkerSet (Vertical, Standard_False);
+ myGroup->AddPrimitiveArray (Vertical, Standard_False);
}
myGroup->SetMinMaxValues(-myXSize, -myYSize, 0.0, myXSize, myYSize, 0.0);
return myGridEcho;
}
+#include <Graphic3d_ArrayOfPoints.hxx>
#include <Visual3d_TransientManager.hxx>
void V3d_Viewer::ShowGridEcho( const Handle(V3d_View)& aView,
const Graphic3d_Vertex& aVertex ) {
#ifdef OCC281
myGridEchoGroup->SetPrimitivesAspect( myGridEchoAspect );
#endif
- myGridEchoGroup->Marker(aVertex);
+ Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+ anArrayOfPoints->AddVertex (aVertex.X(), aVertex.Y(), aVertex.Z());
+ myGridEchoGroup->AddPrimitiveArray (anArrayOfPoints);
+
Visual3d_TransientManager::BeginDraw(
aView->View(), Standard_False, Standard_False);
Visual3d_TransientManager::DrawStructure (myGridEchoStructure);
#include <Graphic3d_ArrayOfQuadrangles.hxx>
#include <Graphic3d_ArrayOfQuadrangleStrips.hxx>
#include <Graphic3d_ArrayOfPolygons.hxx>
+#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Standard_Real.hxx>
#include <Select3D_SensitiveTriangle.hxx>
#include <Select3D_SensitiveCurve.hxx>
+#include <Select3D_SensitivePoint.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <StdPrs_Curve.hxx>
#include <BRepExtrema_ExtPF.hxx>
#include <Prs3d_LineAspect.hxx>
+#include <Prs3d_PointAspect.hxx>
+
+#include <Image_AlienPixMap.hxx>
#ifdef HAVE_STRINGS_H
#include <strings.h>
public:
- MyPArrayObject (const Handle(Graphic3d_ArrayOfPrimitives) theArray)
+ MyPArrayObject (const Handle(Graphic3d_ArrayOfPrimitives) theArray,
+ Handle(Graphic3d_AspectMarker3d) theMarkerAspect = NULL)
{
myArray = theArray;
+ myMarkerAspect = theMarkerAspect;
}
DEFINE_STANDARD_RTTI(MyPArrayObject);
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode);
- void ComputeSelection (const Handle(SelectMgr_Selection)& /*aSelection*/,
- const Standard_Integer /*aMode*/) {};
+ void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
+ const Standard_Integer /*theMode*/);
protected:
Handle(Graphic3d_ArrayOfPrimitives) myArray;
+ Handle(Graphic3d_AspectMarker3d) myMarkerAspect;
};
const Standard_Integer /*aMode*/)
{
aPresentation->Clear();
+ if (!myMarkerAspect.IsNull())
+ {
+ Prs3d_Root::CurrentGroup (aPresentation)->SetGroupPrimitivesAspect (myMarkerAspect);
+ }
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (myArray);
}
+void MyPArrayObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
+ const Standard_Integer /*theMode*/)
+{
+ Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner (this);
+
+ for (Standard_Integer anIter = 1; anIter <= myArray->VertexNumber(); anIter++)
+ {
+
+ Handle(Select3D_SensitivePoint) aSensetivePoint = new Select3D_SensitivePoint (anEntityOwner, myArray->Vertice (anIter));
+ theSelection->Add (aSensetivePoint);
+ }
+}
+
static bool CheckInputCommand (const TCollection_AsciiString theCommand,
const char **theArgStr, int &theArgIndex,
int theArgCount, int theMaxArgs)
// create an array of primitives by types
Handle(Graphic3d_ArrayOfPrimitives) anArray;
+ Handle(Graphic3d_AspectMarker3d) anAspPoints;
if (anArrayType == "points")
+ {
anArray = new Graphic3d_ArrayOfPoints (aVertexNum);
+ anAspPoints = new Graphic3d_AspectMarker3d (Aspect_TOM_POINT, Quantity_NOC_YELLOW, 1.0f);
+ }
else if (anArrayType == "segments")
anArray = new Graphic3d_ArrayOfSegments (aVertexNum, aEdgeNum, hasVColors);
else if (anArrayType == "polylines")
}
// create primitives array object
- Handle (MyPArrayObject) aPObject = new MyPArrayObject (anArray);
+ Handle(MyPArrayObject) aPObject = new MyPArrayObject (anArray, anAspPoints);
// register the object in map
VDisplayAISObject (aName, aPObject);
return 0;
}
+//=======================================================================
+//function : VMarkersTest
+//purpose : Draws an array of markers for testing purposes.
+//=======================================================================
+static Standard_Integer VMarkersTest (Draw_Interpretor& theDI,
+ Standard_Integer theArgNb,
+ const char** theArgVec)
+{
+ Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
+ if (aContext.IsNull())
+ {
+ std::cerr << "Call 'vinit' before!\n";
+ return 1;
+ }
+
+ if (theArgNb < 5)
+ {
+ std::cerr << "Usage :\n " << theArgVec[0]
+ << "name X Y Z [PointsOnSide=10] [MarkerType=0] [Scale=1.0] [FileName=ImageFile]\n";
+ return 1;
+ }
+
+ Standard_Integer anArgIter = 1;
+
+ TCollection_AsciiString aName (theArgVec[anArgIter++]);
+ TCollection_AsciiString aFileName;
+ gp_XYZ aPnt (Atof (theArgVec[anArgIter]),
+ Atof (theArgVec[anArgIter + 1]),
+ Atof (theArgVec[anArgIter + 2]));
+ anArgIter += 3;
+
+ Standard_Integer aPointsOnSide = 10;
+ Standard_Integer aMarkerType = -1;
+ Standard_Real aScale = 1.0;
+ for (; anArgIter < theArgNb; ++anArgIter)
+ {
+ const TCollection_AsciiString anArg (theArgVec[anArgIter]);
+ if (anArg.Search ("PointsOnSide=") > -1)
+ {
+ aPointsOnSide = anArg.Token ("=", 2).IntegerValue();
+ }
+ else if (anArg.Search ("MarkerType=") > -1)
+ {
+ aMarkerType = anArg.Token ("=", 2).IntegerValue();
+ }
+ else if (anArg.Search ("Scale=") > -1)
+ {
+ aScale = anArg.Token ("=", 2).RealValue();
+ }
+ else if (anArg.Search ("FileName=") > -1)
+ {
+ aFileName = anArg.Token ("=", 2);
+ }
+ else
+ {
+ std::cerr << "Wrong argument: " << anArg << "\n";
+ return 1;
+ }
+ }
+
+ Handle(Graphic3d_AspectMarker3d) anAspect;
+ Handle(Image_AlienPixMap) anImage;
+ Quantity_Color aColor (Quantity_NOC_GREEN1);
+ if ((aMarkerType == Aspect_TOM_USERDEFINED || aMarkerType < 0)
+ && !aFileName.IsEmpty())
+ {
+ anImage = new Image_AlienPixMap();
+ if (!anImage->Load (aFileName))
+ {
+ std::cerr << "Could not load image from file '" << aFileName << "'!\n";
+ return 1;
+ }
+ anAspect = new Graphic3d_AspectMarker3d (anImage);
+ }
+ else
+ {
+ anAspect = new Graphic3d_AspectMarker3d (aMarkerType >= 0 ? (Aspect_TypeOfMarker )aMarkerType : Aspect_TOM_POINT, aColor, aScale);
+ }
+
+ Handle(Graphic3d_ArrayOfPrimitives) anArray = new Graphic3d_ArrayOfPoints ((Standard_Integer )Pow (aPointsOnSide, 3), aPointsOnSide != 1);
+ if (aPointsOnSide == 1)
+ {
+ anArray->AddVertex (aPnt);
+ }
+ else
+ {
+ for (Standard_Real i = 1; i <= aPointsOnSide; i++)
+ {
+ for (Standard_Real j = 1; j <= aPointsOnSide; j++)
+ {
+ for (Standard_Real k = 1; k <= aPointsOnSide; k++)
+ {
+ anArray->AddVertex (aPnt.X() + i, aPnt.Y() + j, aPnt.Z() + k);
+ anArray->SetVertexColor (anArray->VertexNumber(),
+ i / aPointsOnSide,
+ j / aPointsOnSide,
+ k / aPointsOnSide);
+ }
+ }
+ }
+ }
+
+ Handle(MyPArrayObject) aPObject = new MyPArrayObject (anArray, anAspect);
+ VDisplayAISObject (aName, aPObject);
+
+ return 0;
+}
+
//=======================================================================
//function : ObjectsCommands
//purpose :
"- turns on/off drawing of face boundaries for ais object "
"and defines boundary line style.",
__FILE__, VShowFaceBoundary, group);
+
+ theCommands.Add ("vmarkerstest",
+ "vmarkerstest: name X Y Z [PointsOnSide=10] [MarkerType=0] [Scale=1.0] [FileName=ImageFile]\n",
+ __FILE__, VMarkersTest, group);
}
return 0;
}
+//==============================================================================
+//function : VCaps
+//purpose :
+//==============================================================================
+
+static int VCaps (Draw_Interpretor& theDI,
+ Standard_Integer theArgNb,
+ const char** theArgVec)
+{
+ OpenGl_Caps* aCaps = &ViewerTest_myDefaultCaps;
+ Handle(OpenGl_GraphicDriver) aDriver;
+ Handle(AIS_InteractiveContext) aContextAIS = ViewerTest::GetAISContext();
+ if (!aContextAIS.IsNull())
+ {
+ aDriver = Handle(OpenGl_GraphicDriver)::DownCast (aContextAIS->CurrentViewer()->Driver());
+ aCaps = &aDriver->ChangeOptions();
+ }
+
+ if (theArgNb < 2)
+ {
+ theDI << "VBO: " << (aCaps->vboDisable ? "0" : "1") << "\n";
+ theDI << "Sprites: " << (aCaps->pntSpritesDisable ? "0" : "1") << "\n";
+ return 0;
+ }
+
+ for (Standard_Integer anArgIter = 1; anArgIter < theArgNb; ++anArgIter)
+ {
+ const TCollection_AsciiString anArg (theArgVec[anArgIter]);
+ if (anArg.Search ("vbo=") > -1)
+ {
+ aCaps->vboDisable = anArg.Token ("=", 2).IntegerValue() == 0;
+ }
+ else if (anArg.Search ("sprites=") > -1)
+ {
+ aCaps->pntSpritesDisable = anArg.Token ("=", 2).IntegerValue() == 0;
+ }
+ else
+ {
+ std::cerr << "Unknown argument: " << anArg << "\n";
+ }
+ }
+ if (aCaps != &ViewerTest_myDefaultCaps)
+ {
+ ViewerTest_myDefaultCaps = *aCaps;
+ }
+ return 0;
+}
+
//==============================================================================
//function : VMemGpu
//purpose :
theCommands.Add ("vvbo",
"vvbo [{0|1}] : turn VBO usage On/Off; affects only newly displayed objects",
__FILE__, VVbo, group);
+ theCommands.Add ("vcaps",
+ "vcaps [vbo={0|1}] [sprites={0|1}] : modify particular graphic driver options",
+ __FILE__, VCaps, group);
theCommands.Add ("vmemgpu",
"vmemgpu [f]: print system-dependent GPU memory information if available;"
" with f option returns free memory in bytes",
--- /dev/null
+puts "========"
+puts "OCC24131 Markers using Point Sprites"
+puts "========"
+
+# reflects Aspect_TypeOfMarker enumeration
+set aMarkerTypeNames {
+ Aspect_TOM_POINT
+ Aspect_TOM_PLUS
+ Aspect_TOM_STAR
+ Aspect_TOM_X
+ Aspect_TOM_O
+ Aspect_TOM_O_POINT
+ Aspect_TOM_O_PLUS
+ Aspect_TOM_O_STAR
+ Aspect_TOM_O_X
+ Aspect_TOM_RING1
+ Aspect_TOM_RING2
+ Aspect_TOM_RING3
+ Aspect_TOM_BALL
+ Aspect_TOM_USERDEFINED
+}
+
+# generate custom marker
+set aCustom1 $imagedir/${casename}_m1.png
+set aCustom2 $imagedir/${casename}_m2.png
+box b 1 1 1
+vinit name=Driver0/Viewer1/View1 l=32 t=32 w=512 h=512
+vclear
+vdisplay b
+vaxo
+vfit
+vdump $aCustom1 rgba 32 32
+vsetdispmode b 1
+vsetcolor b RED
+vrotate 1 0 0
+vdump $aCustom2 rgba 32 32
+
+# draw box in advance which should fit all our markers
+box b -8 -8 0 16 16 2
+puts "hI"
+for { set aMode 0 } { $aMode <= 1 } { incr aMode } {
+ set aTitle "bitmaps"
+ if { $aMode == 1 } { set aTitle "sprites" }
+ vcaps sprites=$aMode
+ set aV "Driver${aMode}/Viewer1/View1"
+ vinit name=$aV l=32 t=32 w=512 h=512
+ vactivate $aV
+ vclear
+
+ vbottom
+ vdisplay b
+ vfit
+ verase b
+
+ for { set aMarkerType 0 } { $aMarkerType <= 13 } { incr aMarkerType } {
+ set aRow [expr $aMarkerType - 7]
+ set aCol 5
+ set aName [lindex $aMarkerTypeNames $aMarkerType]
+ vdrawtext "$aName" 0 [expr $aRow + 0.5] 0 128 255 255 1 1 000 0 12 2 Arial
+ if { $aMarkerType == 13 } {
+ vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom1
+ set aCol [expr $aCol - 1]
+ vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom2
+ } else {
+ for { set aMarkerScale 1.0 } { $aMarkerScale <= 7 } { set aMarkerScale [expr $aMarkerScale + 0.5] } {
+ vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 MarkerType=$aMarkerType Scale=$aMarkerScale PointsOnSide=1
+ set aCol [expr $aCol - 1]
+ }
+ }
+ }
+ vdump $imagedir/${casename}_${aTitle}.png
+}