org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL Class Reference

#include </home/scilab/compilation_chain/sci_checkOut/scilab/modules/renderer/src/jni/BackTrihedronDrawerGL.hxx>


Public Member Functions

 BackTrihedronDrawerGL (JavaVM *jvm_)
 BackTrihedronDrawerGL (JavaVM *jvm_, jobject JObj)
 ~BackTrihedronDrawerGL ()
void synchronize ()
void endSynchronize ()
void display ()
void initializeDrawing (int figureIndex)
void endDrawing ()
void show (int figureIndex)
void destroy (int figureIndex)
void setFigureIndex (int figureIndex)
void setBoxParameters (int hiddenAxisColor, float thickness)
void drawBox (double xMin, double xMax, double yMin, double yMax, double zMin, double zMax, int concealedCornerIndex)

Static Public Member Functions

static const std::string className ()

Private Member Functions

JNIEnv * getCurrentEnv ()

Private Attributes

JavaVM * jvm
jobject instance
jclass instanceClass
jmethodID voiddisplayID
jmethodID voidinitializeDrawingjintID
jmethodID voidendDrawingID
jmethodID voidshowjintID
jmethodID voiddestroyjintID
jmethodID voidsetFigureIndexjintID
jmethodID voidsetBoxParametersjintjfloatID
jmethodID voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID


Detailed Description

Definition at line 51 of file BackTrihedronDrawerGL.hxx.


Constructor & Destructor Documentation

org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::BackTrihedronDrawerGL ( JavaVM *  jvm_  ) 

Create a wrapping of the object from a JNIEnv. It will call the default constructor

Parameters:
JEnv_ the Java Env

Definition at line 59 of file BackTrihedronDrawerGL.cpp.

References className(), getCurrentEnv(), instance, instanceClass, jvm, NULL, voiddestroyjintID, voiddisplayID, voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID, voidendDrawingID, voidinitializeDrawingjintID, voidsetBoxParametersjintjfloatID, voidsetFigureIndexjintID, and voidshowjintID.

00059                                                           {
00060 jmethodID constructObject = NULL ;
00061 jobject localInstance ;
00062 jclass localClass ;
00063 const std::string construct="<init>";
00064 const std::string param="()V";
00065 jvm=jvm_;
00066 
00067 JNIEnv * curEnv = getCurrentEnv();
00068 
00069 localClass = curEnv->FindClass( this->className().c_str() ) ;
00070 if (localClass == NULL) {
00071   throw GiwsException::JniClassNotFoundException(curEnv, this->className());
00072 }
00073 
00074 this->instanceClass = (jclass) curEnv->NewGlobalRef(localClass) ;
00075 
00076 /* localClass is not needed anymore */
00077 curEnv->DeleteLocalRef(localClass);
00078 
00079 if (this->instanceClass == NULL) {
00080 throw GiwsException::JniObjectCreationException(curEnv, this->className());
00081 }
00082 
00083 
00084 constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ;
00085 if(constructObject == NULL){
00086 throw GiwsException::JniObjectCreationException(curEnv, this->className());
00087 }
00088 
00089 localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ;
00090 if(localInstance == NULL){
00091 throw GiwsException::JniObjectCreationException(curEnv, this->className());
00092 }
00093  
00094 this->instance = curEnv->NewGlobalRef(localInstance) ;
00095 if(this->instance == NULL){
00096 throw GiwsException::JniObjectCreationException(curEnv, this->className());
00097 }
00098 /* localInstance not needed anymore */
00099 curEnv->DeleteLocalRef(localInstance);
00100 
00101                 /* Methods ID set to NULL */
00102 voiddisplayID=NULL; 
00103 voidinitializeDrawingjintID=NULL; 
00104 voidendDrawingID=NULL; 
00105 voidshowjintID=NULL; 
00106 voiddestroyjintID=NULL; 
00107 voidsetFigureIndexjintID=NULL; 
00108 voidsetBoxParametersjintjfloatID=NULL; 
00109 voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID=NULL; 
00110 
00111 
00112 }

Here is the call graph for this function:

org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::BackTrihedronDrawerGL ( JavaVM *  jvm_,
jobject  JObj 
)

Create a wrapping of an already existing object from a JNIEnv. The object must have already been instantiated

Parameters:
JEnv_ the Java Env
JObj the object

Definition at line 114 of file BackTrihedronDrawerGL.cpp.

References className(), getCurrentEnv(), instance, instanceClass, jvm, NULL, voiddestroyjintID, voiddisplayID, voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID, voidendDrawingID, voidinitializeDrawingjintID, voidsetBoxParametersjintjfloatID, voidsetFigureIndexjintID, and voidshowjintID.

00114                                                                         {
00115         jvm=jvm_;
00116 
00117         JNIEnv * curEnv = getCurrentEnv();
00118 
00119 jclass localClass = curEnv->GetObjectClass(JObj);
00120         this->instanceClass = (jclass) curEnv->NewGlobalRef(localClass);
00121         curEnv->DeleteLocalRef(localClass);
00122 
00123         if (this->instanceClass == NULL) {
00124 throw GiwsException::JniObjectCreationException(curEnv, this->className());
00125         }
00126 
00127         this->instance = curEnv->NewGlobalRef(JObj) ;
00128         if(this->instance == NULL){
00129 throw GiwsException::JniObjectCreationException(curEnv, this->className());
00130         }
00131         /* Methods ID set to NULL */
00132         voiddisplayID=NULL; 
00133 voidinitializeDrawingjintID=NULL; 
00134 voidendDrawingID=NULL; 
00135 voidshowjintID=NULL; 
00136 voiddestroyjintID=NULL; 
00137 voidsetFigureIndexjintID=NULL; 
00138 voidsetBoxParametersjintjfloatID=NULL; 
00139 voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID=NULL; 
00140 
00141 
00142 }

Here is the call graph for this function:

org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::~BackTrihedronDrawerGL (  ) 

Definition at line 50 of file BackTrihedronDrawerGL.cpp.

References instance, instanceClass, jvm, and NULL.

00050                                               {
00051 JNIEnv * curEnv = NULL;
00052 this->jvm->AttachCurrentThread((void **) &curEnv, NULL);
00053 
00054 curEnv->DeleteGlobalRef(this->instance);
00055 curEnv->DeleteGlobalRef(this->instanceClass);
00056 }


Member Function Documentation

JNIEnv * org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::getCurrentEnv (  )  [private]

Get the environment matching to the current thread.

Definition at line 43 of file BackTrihedronDrawerGL.cpp.

References jvm, and NULL.

Referenced by BackTrihedronDrawerGL(), destroy(), display(), drawBox(), endDrawing(), endSynchronize(), initializeDrawing(), setBoxParameters(), setFigureIndex(), show(), and synchronize().

00043                                               {
00044 JNIEnv * curEnv = NULL;
00045 this->jvm->AttachCurrentThread((void **) &curEnv, NULL);
00046 return curEnv;
00047 }

Here is the caller graph for this function:

void org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::synchronize (  ) 

Enter monitor associated with the object. Equivalent of creating a "synchronized(obj)" scope in Java.

Definition at line 147 of file BackTrihedronDrawerGL.cpp.

References getCurrentEnv(), and instance.

00147                                         {
00148 if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
00149 std::cerr << "Fail to enter monitor." << std::endl;
00150 exit(EXIT_FAILURE);
00151 }
00152 }

Here is the call graph for this function:

void org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::endSynchronize (  ) 

Exit monitor associated with the object. Equivalent of ending a "synchronized(obj)" scope.

Definition at line 155 of file BackTrihedronDrawerGL.cpp.

References getCurrentEnv(), and instance.

00155                                            {
00156 if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
00157 std::cerr << "Fail to exit monitor." << std::endl;
00158 exit(EXIT_FAILURE);
00159 }
00160 }

Here is the call graph for this function:

void org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::display ( void   ) 

Definition at line 164 of file BackTrihedronDrawerGL.cpp.

References getCurrentEnv(), instance, instanceClass, NULL, and voiddisplayID.

Referenced by sciGraphics::BackTrihedronDrawerJavaMapper::display().

00164                                     {
00165 
00166 JNIEnv * curEnv = getCurrentEnv();
00167 
00168 if (voiddisplayID==NULL) { /* Use the cache Luke */ voiddisplayID = curEnv->GetMethodID(this->instanceClass, "display", "()V" ) ;
00169 if (voiddisplayID == NULL) {
00170 throw GiwsException::JniMethodNotFoundException(curEnv, "display");
00171 }
00172 }
00173                          curEnv->CallVoidMethod( this->instance, voiddisplayID );
00174                         if (curEnv->ExceptionCheck()) {
00175 throw GiwsException::JniCallMethodException(curEnv);
00176 }
00177 }

Here is the call graph for this function:

Here is the caller graph for this function:

void org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::initializeDrawing ( int  figureIndex  ) 

Definition at line 179 of file BackTrihedronDrawerGL.cpp.

References getCurrentEnv(), instance, instanceClass, NULL, and voidinitializeDrawingjintID.

Referenced by sciGraphics::BackTrihedronDrawerJavaMapper::initializeDrawing().

00179                                                              {
00180 
00181 JNIEnv * curEnv = getCurrentEnv();
00182 
00183 if (voidinitializeDrawingjintID==NULL) { /* Use the cache Luke */ voidinitializeDrawingjintID = curEnv->GetMethodID(this->instanceClass, "initializeDrawing", "(I)V" ) ;
00184 if (voidinitializeDrawingjintID == NULL) {
00185 throw GiwsException::JniMethodNotFoundException(curEnv, "initializeDrawing");
00186 }
00187 }
00188                          curEnv->CallVoidMethod( this->instance, voidinitializeDrawingjintID ,figureIndex);
00189                         if (curEnv->ExceptionCheck()) {
00190 throw GiwsException::JniCallMethodException(curEnv);
00191 }
00192 }

Here is the call graph for this function:

Here is the caller graph for this function:

void org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::endDrawing ( void   ) 

Definition at line 194 of file BackTrihedronDrawerGL.cpp.

References getCurrentEnv(), instance, instanceClass, NULL, and voidendDrawingID.

Referenced by sciGraphics::BackTrihedronDrawerJavaMapper::endDrawing().

00194                                        {
00195 
00196 JNIEnv * curEnv = getCurrentEnv();
00197 
00198 if (voidendDrawingID==NULL) { /* Use the cache Luke */ voidendDrawingID = curEnv->GetMethodID(this->instanceClass, "endDrawing", "()V" ) ;
00199 if (voidendDrawingID == NULL) {
00200 throw GiwsException::JniMethodNotFoundException(curEnv, "endDrawing");
00201 }
00202 }
00203                          curEnv->CallVoidMethod( this->instance, voidendDrawingID );
00204                         if (curEnv->ExceptionCheck()) {
00205 throw GiwsException::JniCallMethodException(curEnv);
00206 }
00207 }

Here is the call graph for this function:

Here is the caller graph for this function:

void org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::show ( int  figureIndex  ) 

Definition at line 209 of file BackTrihedronDrawerGL.cpp.

References getCurrentEnv(), instance, instanceClass, NULL, and voidshowjintID.

Referenced by sciGraphics::BackTrihedronDrawerJavaMapper::show().

00209                                                 {
00210 
00211 JNIEnv * curEnv = getCurrentEnv();
00212 
00213 if (voidshowjintID==NULL) { /* Use the cache Luke */ voidshowjintID = curEnv->GetMethodID(this->instanceClass, "show", "(I)V" ) ;
00214 if (voidshowjintID == NULL) {
00215 throw GiwsException::JniMethodNotFoundException(curEnv, "show");
00216 }
00217 }
00218                          curEnv->CallVoidMethod( this->instance, voidshowjintID ,figureIndex);
00219                         if (curEnv->ExceptionCheck()) {
00220 throw GiwsException::JniCallMethodException(curEnv);
00221 }
00222 }

Here is the call graph for this function:

Here is the caller graph for this function:

void org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::destroy ( int  figureIndex  ) 

Definition at line 224 of file BackTrihedronDrawerGL.cpp.

References getCurrentEnv(), instance, instanceClass, NULL, and voiddestroyjintID.

Referenced by sciGraphics::BackTrihedronDrawerJavaMapper::destroy().

00224                                                    {
00225 
00226 JNIEnv * curEnv = getCurrentEnv();
00227 
00228 if (voiddestroyjintID==NULL) { /* Use the cache Luke */ voiddestroyjintID = curEnv->GetMethodID(this->instanceClass, "destroy", "(I)V" ) ;
00229 if (voiddestroyjintID == NULL) {
00230 throw GiwsException::JniMethodNotFoundException(curEnv, "destroy");
00231 }
00232 }
00233                          curEnv->CallVoidMethod( this->instance, voiddestroyjintID ,figureIndex);
00234                         if (curEnv->ExceptionCheck()) {
00235 throw GiwsException::JniCallMethodException(curEnv);
00236 }
00237 }

Here is the call graph for this function:

Here is the caller graph for this function:

void org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::setFigureIndex ( int  figureIndex  ) 

Definition at line 239 of file BackTrihedronDrawerGL.cpp.

References getCurrentEnv(), instance, instanceClass, NULL, and voidsetFigureIndexjintID.

Referenced by sciGraphics::BackTrihedronDrawerJavaMapper::setFigureIndex().

00239                                                           {
00240 
00241 JNIEnv * curEnv = getCurrentEnv();
00242 
00243 if (voidsetFigureIndexjintID==NULL) { /* Use the cache Luke */ voidsetFigureIndexjintID = curEnv->GetMethodID(this->instanceClass, "setFigureIndex", "(I)V" ) ;
00244 if (voidsetFigureIndexjintID == NULL) {
00245 throw GiwsException::JniMethodNotFoundException(curEnv, "setFigureIndex");
00246 }
00247 }
00248                          curEnv->CallVoidMethod( this->instance, voidsetFigureIndexjintID ,figureIndex);
00249                         if (curEnv->ExceptionCheck()) {
00250 throw GiwsException::JniCallMethodException(curEnv);
00251 }
00252 }

Here is the call graph for this function:

Here is the caller graph for this function:

void org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::setBoxParameters ( int  hiddenAxisColor,
float  thickness 
)

Definition at line 254 of file BackTrihedronDrawerGL.cpp.

References getCurrentEnv(), instance, instanceClass, NULL, and voidsetBoxParametersjintjfloatID.

Referenced by sciGraphics::BackTrihedronDrawerJavaMapper::setBoxParameters().

00254                                                                                  {
00255 
00256 JNIEnv * curEnv = getCurrentEnv();
00257 
00258 if (voidsetBoxParametersjintjfloatID==NULL) { /* Use the cache Luke */ voidsetBoxParametersjintjfloatID = curEnv->GetMethodID(this->instanceClass, "setBoxParameters", "(IF)V" ) ;
00259 if (voidsetBoxParametersjintjfloatID == NULL) {
00260 throw GiwsException::JniMethodNotFoundException(curEnv, "setBoxParameters");
00261 }
00262 }
00263                          curEnv->CallVoidMethod( this->instance, voidsetBoxParametersjintjfloatID ,hiddenAxisColor, thickness);
00264                         if (curEnv->ExceptionCheck()) {
00265 throw GiwsException::JniCallMethodException(curEnv);
00266 }
00267 }

Here is the call graph for this function:

Here is the caller graph for this function:

void org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::drawBox ( double  xMin,
double  xMax,
double  yMin,
double  yMax,
double  zMin,
double  zMax,
int  concealedCornerIndex 
)

Definition at line 269 of file BackTrihedronDrawerGL.cpp.

References getCurrentEnv(), instance, instanceClass, NULL, and voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID.

Referenced by sciGraphics::BackTrihedronDrawerJavaMapper::drawBox().

00269                                                                                                                                           {
00270 
00271 JNIEnv * curEnv = getCurrentEnv();
00272 
00273 if (voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID==NULL) { /* Use the cache Luke */ voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID = curEnv->GetMethodID(this->instanceClass, "drawBox", "(DDDDDDI)V" ) ;
00274 if (voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID == NULL) {
00275 throw GiwsException::JniMethodNotFoundException(curEnv, "drawBox");
00276 }
00277 }
00278                          curEnv->CallVoidMethod( this->instance, voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID ,xMin, xMax, yMin, yMax, zMin, zMax, concealedCornerIndex);
00279                         if (curEnv->ExceptionCheck()) {
00280 throw GiwsException::JniCallMethodException(curEnv);
00281 }
00282 }

Here is the call graph for this function:

Here is the caller graph for this function:

static const std::string org_scilab_modules_renderer_subwinDrawing::BackTrihedronDrawerGL::className (  )  [inline, static]

Get class name to use for static methods

Returns:
class name to use for static methods

Definition at line 128 of file BackTrihedronDrawerGL.hxx.

Referenced by BackTrihedronDrawerGL().

00129                 {
00130                 return "org/scilab/modules/renderer/subwinDrawing/BackTrihedronDrawerGL";
00131                 }

Here is the caller graph for this function:


Field Documentation

Definition at line 57 of file BackTrihedronDrawerGL.hxx.

Referenced by BackTrihedronDrawerGL(), and display().

Definition at line 58 of file BackTrihedronDrawerGL.hxx.

Referenced by BackTrihedronDrawerGL(), and initializeDrawing().

Definition at line 59 of file BackTrihedronDrawerGL.hxx.

Referenced by BackTrihedronDrawerGL(), and endDrawing().

Definition at line 60 of file BackTrihedronDrawerGL.hxx.

Referenced by BackTrihedronDrawerGL(), and show().

Definition at line 61 of file BackTrihedronDrawerGL.hxx.

Referenced by BackTrihedronDrawerGL(), and destroy().

Definition at line 62 of file BackTrihedronDrawerGL.hxx.

Referenced by BackTrihedronDrawerGL(), and setFigureIndex().

Definition at line 63 of file BackTrihedronDrawerGL.hxx.

Referenced by BackTrihedronDrawerGL(), and setBoxParameters().

Definition at line 64 of file BackTrihedronDrawerGL.hxx.

Referenced by BackTrihedronDrawerGL(), and drawBox().


The documentation for this class was generated from the following files:

Generated on Tue Sep 9 18:31:49 2008 for Scilab [trunk] by  doxygen 1.5.5