Adjusting testing cases for current state of OCCT
[occt.git] / samples / java / java / CASCADESamplesJni / Quantity_Color.java
CommitLineData
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
17package CASCADESamplesJni;
18
19import CASCADESamplesJni.Standard_Storable;
20import CASCADESamplesJni.Quantity_NameOfColor;
21import jcas.Standard_Short;
22import jcas.Standard_Real;
23import CASCADESamplesJni.Quantity_TypeOfColor;
24import jcas.Standard_Boolean;
25import jcas.Standard_CString;
26
27
28public class Quantity_Color extends CASCADESamplesJni.Standard_Storable {
29
30 static {
31 System.loadLibrary("CASCADESamplesJni");
32 }
33
34public Quantity_Color() {
35 Quantity_Color_Create_1();
36}
37
38private final native void Quantity_Color_Create_1();
39
40public Quantity_Color(short AName) {
41 Quantity_Color_Create_2(AName);
42}
43
44private final native void Quantity_Color_Create_2(short AName);
45
46public Quantity_Color(double R1,double R2,double R3,short AType) {
47 Quantity_Color_Create_3(R1,R2,R3,AType);
48}
49
50private final native void Quantity_Color_Create_3(double R1,double R2,double R3,short AType);
51
52native public final Quantity_Color Assign(Quantity_Color Other);
53native public final void ChangeContrast(double ADelta);
54native public final void ChangeIntensity(double ADelta);
55final public void SetValues(short AName) {
56 Quantity_Color_SetValues_1(AName);
57}
58
59private final native void Quantity_Color_SetValues_1(short AName);
60
61final public void SetValues(double R1,double R2,double R3,short AType) {
62 Quantity_Color_SetValues_2(R1,R2,R3,AType);
63}
64
65private final native void Quantity_Color_SetValues_2(double R1,double R2,double R3,short AType);
66
67native public final void Delta(Quantity_Color AColor,Standard_Real DC,Standard_Real DI);
68native public final double Distance(Quantity_Color AColor);
69native public final double SquareDistance(Quantity_Color AColor);
70native public final double Blue();
71native public final double Green();
72native public final double Hue();
73native public final boolean IsDifferent(Quantity_Color Other);
74native public final boolean IsEqual(Quantity_Color Other);
75native public final double Light();
76final public short Name() {
77 return Quantity_Color_Name_1();
78}
79
80private final native short Quantity_Color_Name_1();
81
82native public final double Red();
83native public final double Saturation();
84native public final void Values(Standard_Real R1,Standard_Real R2,Standard_Real R3,short AType);
85native public static void SetEpsilon(double AnEpsilon);
86native public static double Epsilon();
87static public short Name(double R,double G,double B) {
88 return Quantity_Color_Name_2(R,G,B);
89}
90
91private static native short Quantity_Color_Name_2(double R,double G,double B);
92
93native public static Standard_CString StringName(short AColor);
94native public static void HlsRgb(double H,double L,double S,Standard_Real R,Standard_Real G,Standard_Real B);
95native public static void RgbHls(double R,double G,double B,Standard_Real H,Standard_Real L,Standard_Real S);
96native public static void Test();
97
98
99public native static void FinalizeValue(long anHID);
100
101public void finalize() {
102 synchronized(myCasLock) {
103 if ( aVirer != 0 ) FinalizeValue(HID);
104 HID = 0;
105 }
106}
107
108}