7fd59977 |
1 | // Java Native Class from Cas.Cade |
2 | // Copyright (C) 1991,1999 by |
3 | // |
4 | // MATRA DATAVISION, FRANCE |
5 | // |
6 | // This software is furnished in accordance with the terms and conditions |
7 | // of the contract and with the inclusion of the above copyright notice. |
8 | // This software or any other copy thereof may not be provided or otherwise |
9 | // be made available to any other person. No title to an ownership of the |
10 | // software is hereby transferred. |
11 | // |
12 | // At the termination of the contract, the software and all copies of this |
13 | // software must be deleted. |
14 | // |
15 | |
16 | |
17 | package SampleViewer3DJni; |
18 | |
19 | import jcas.Object; |
20 | import jcas.Standard_CString; |
21 | import jcas.Standard_Boolean; |
22 | import jcas.Standard_Integer; |
23 | import jcas.Standard_ShortReal; |
24 | import CASCADESamplesJni.TColStd_Array2OfReal; |
25 | import SampleViewer3DJni.Graphic3d_TypeOfComposition; |
26 | import jcas.Standard_Short; |
27 | import SampleViewer3DJni.Graphic3d_TypeOfTexture; |
28 | import SampleViewer3DJni.AlienImage_AlienImage; |
29 | |
30 | |
31 | public class Graphic3d_GraphicDriver extends SampleViewer3DJni.Aspect_GraphicDriver { |
32 | |
33 | static { |
34 | System.loadLibrary("SampleViewer3DJni"); |
35 | } |
36 | |
37 | public Graphic3d_GraphicDriver(Standard_CString AShrName) { |
38 | Graphic3d_GraphicDriver_Create_0(AShrName); |
39 | } |
40 | |
41 | private final native void Graphic3d_GraphicDriver_Create_0(Standard_CString AShrName); |
42 | |
43 | native public boolean Begin(Standard_CString ADisplay); |
44 | native public void End(); |
45 | native public int InquireLightLimit(); |
46 | native public int InquirePlaneLimit(); |
47 | native public int InquireViewLimit(); |
48 | native public boolean InquireTextureAvailable(); |
49 | native public void InitPick(); |
50 | native public void EndAddMode(); |
51 | native public void BeginPolyline(); |
52 | public void Draw(float X,float Y,float Z) { |
53 | Graphic3d_GraphicDriver_Draw_1(X,Y,Z); |
54 | } |
55 | |
56 | private native void Graphic3d_GraphicDriver_Draw_1(float X,float Y,float Z); |
57 | |
58 | native public void EndImmediatMode(int Synchronize); |
59 | native public void EndPolyline(); |
60 | public void Move(float X,float Y,float Z) { |
61 | Graphic3d_GraphicDriver_Move_1(X,Y,Z); |
62 | } |
63 | |
64 | private native void Graphic3d_GraphicDriver_Move_1(float X,float Y,float Z); |
65 | |
66 | native public void SetLineColor(float R,float G,float B); |
67 | native public void SetLineType(int Type); |
68 | native public void SetLineWidth(float Width); |
69 | native public void SetMinMax(float X1,float Y1,float Z1,float X2,float Y2,float Z2); |
70 | native public void Transform(TColStd_Array2OfReal AMatrix,short AType); |
71 | native public int CreateTexture(short Type,AlienImage_AlienImage Image,Standard_CString FileName); |
72 | native public void DestroyTexture(int TexId); |
73 | native public void BeginPolygon2d(); |
74 | native public void BeginPolyline2d(); |
75 | public void Draw(float X,float Y) { |
76 | Graphic3d_GraphicDriver_Draw_2(X,Y); |
77 | } |
78 | |
79 | private native void Graphic3d_GraphicDriver_Draw_2(float X,float Y); |
80 | |
81 | native public void Edge(float X,float Y); |
82 | native public void EndLayer(); |
83 | native public void EndPolygon2d(); |
84 | native public void EndPolyline2d(); |
85 | public void Move(float X,float Y) { |
86 | Graphic3d_GraphicDriver_Move_2(X,Y); |
87 | } |
88 | |
89 | private native void Graphic3d_GraphicDriver_Move_2(float X,float Y); |
90 | |
91 | native public void Rectangle(float X,float Y,float Width,float Height); |
92 | native public void SetColor(float R,float G,float B); |
93 | native public void SetLineAttributes(int Type,float Width); |
94 | native public void SetTextAttributes(int Font,int Type,float R,float G,float B); |
95 | public void Text(Standard_CString AText,float X,float Y,float AHeight) { |
96 | Graphic3d_GraphicDriver_Text_5(AText,X,Y,AHeight); |
97 | } |
98 | |
99 | private native void Graphic3d_GraphicDriver_Text_5(Standard_CString AText,float X,float Y,float AHeight); |
100 | |
101 | native public final void PrintBoolean(Standard_CString AComment,boolean AValue); |
102 | native public final void PrintFunction(Standard_CString AFunc); |
103 | native public final void PrintInteger(Standard_CString AComment,int AValue); |
104 | native public final void PrintIResult(Standard_CString AFunc,int AResult); |
105 | native public final void PrintShortReal(Standard_CString AComment,float AValue); |
106 | native public final void PrintMatrix(Standard_CString AComment,TColStd_Array2OfReal AMatrix); |
107 | native public final void PrintString(Standard_CString AComment,Standard_CString AString); |
108 | native public final void SetTrace(int ALevel); |
109 | native public final int Trace(); |
110 | public Graphic3d_GraphicDriver() { |
111 | } |
112 | |
113 | |
114 | |
115 | |
116 | } |