Commit 011d743e authored by Nicolas Van der Noot's avatar Nicolas Van der Noot
Browse files

java ifdef more generic

parent 8331b2c7
......@@ -6,7 +6,7 @@
* In order to use C++ features, you just need to change the extension of this file (.c) to .cc (or .cpp).
*/
#ifdef JAVA
#ifdef VISU_3D
#include "user_realtime.h"
#include "mbs_data.h"
......
......@@ -6,8 +6,6 @@
#include "user_realtime.h"
#include <locale.h>
#include <stdlib.h>
#ifdef APPLE_VISU
......@@ -30,8 +28,6 @@
#define START_VIEWPOINT 0 ///< default initial viewpoint
/*! \brief instantiate a java virtual machine so as to access to the 3D animation facilities of MBSysPad
*
* \return JNI environment
......
#ifdef JAVA
#ifdef VISU_3D
#include "visu_past.h"
#include "java_functions.h"
#include "plot_sdl.h"
#include "realtime_functions.h"
#include "user_realtime.h"
......@@ -165,7 +164,7 @@ void q_past_vector(Simu_realtime *realtime)
* \param[out] realtime real-time structure
* \param[int] tsim simulation time [s]
*/
void java_time_visu_past(Simu_realtime *realtime, double tsim)
void visu_time_past(Simu_realtime *realtime, double tsim)
{
realtime->ext->visu->t_visu_past = tsim;
}
......
......@@ -4,7 +4,7 @@
* \brief functions used to go backward or forward in the simulation time for visualization
*/
#ifdef JAVA
#ifdef VISU_3D
#ifndef _VISU_PAST_H_
#define _VISU_PAST_H_
......@@ -14,7 +14,7 @@
// functions prototypes
void update_past_visu(Simu_realtime *realtime, double tsim);
void q_past_vector(Simu_realtime *realtime);
void java_time_visu_past(Simu_realtime *realtime, double tsim);
void visu_time_past(Simu_realtime *realtime, double tsim);
void update_visu_past(Simu_realtime *realtime, int flag_forward);
#endif
......
......@@ -15,9 +15,12 @@
#include "plot_sdl.h"
#endif
#ifdef VISU_3D
#include "visu_past.h"
#endif
#ifdef JAVA
#include "java_functions.h"
#include "visu_past.h"
#endif
// -- Macros -- //
......@@ -140,10 +143,10 @@ void mbs_realtime_loop(Simu_realtime *realtime, double tsim)
}
#endif
#ifdef JAVA
#ifdef VISU_3D
if (realtime->flag_visu)
{
java_time_visu_past(realtime, tsim);
visu_time_past(realtime, tsim);
}
#endif
......@@ -169,12 +172,16 @@ void mbs_realtime_loop(Simu_realtime *realtime, double tsim)
#endif
// Java visualization
#ifdef JAVA
#ifdef VISU_3D
if (realtime->flag_visu)
{
if (i == 1)
{
update_java(realtime);
#if (defined JAVA)
update_java(realtime);
#elif (defined OPEN_GL)
#endif
}
}
#endif
......
......@@ -13,10 +13,6 @@
#include "events_sdl.h"
#endif
#ifdef JAVA
#include "java_functions.h"
#endif
#ifdef SDL
/*! \brief initialize SDL real-time variables
......
......@@ -3008,12 +3008,16 @@ void break_gestion(Simu_realtime *realtime, double tsim)
plot_screen_sdl(realtime, tsim, 1);
}
#ifdef JAVA
#ifdef VISU_3D
if (realtime->flag_visu)
{
if (visu->change_viewpoint || visu->visu_past_flag)
{
update_java(realtime);
#if (defined JAVA)
update_java(realtime);
#elif (defined OPEN_GL)
#endif
}
}
#endif
......
......@@ -18,10 +18,6 @@
#include "auto_plot.h"
#include "color_sdl.h"
#ifdef JAVA
#include "java_functions.h"
#endif
#include "mbs_data.h"
//#include "user_realtime.h"
......
......@@ -91,7 +91,7 @@ typedef struct{
user_joystick_buttons_ptr user_joystick_buttons;
#endif
#ifdef JAVA
#ifdef VISU_3D
user_realtime_visu_ptr user_realtime_visu;
#endif
#endif
......
......@@ -156,7 +156,7 @@ void mbs_load_user_model_xml(MDS_gen_strct* gen, UserModel* ums){
}
#endif
#ifdef JAVA
#ifdef VISU_3D
void user_realtime_visu(MbsData* s, int nb_models, int *nb_q, double **q_vec){
s->fct.user.user_realtime_visu(s, nb_models, nb_q, q_vec);
}
......
......@@ -53,7 +53,7 @@ typedef void (*mbs_load_user_model_xml_ptr)(MDS_gen_strct* gen, UserModel* ums);
typedef void (*user_joystick_buttons_ptr)(MbsData* mbs_data, int buttonID);
#endif
#ifdef JAVA
#ifdef VISU_3D
typedef void (*user_realtime_visu_ptr)(MbsData* mbs_data, int nb_models, int *nb_q, double **q_vec);
#endif
......
......@@ -6,7 +6,7 @@
* In order to use C++ features, you just need to change the extension of this file (.c) to .cc (or .cpp).
*/
#ifdef JAVA
#ifdef VISU_3D
#include "user_realtime.h"
#include "mbs_data.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment