OpenCAX/entry/src/main/cpp/NativeEGLOCCT/NativeRender.h

73 lines
1.9 KiB
C++

#ifndef NATIVE_RENDER_H
#define NATIVE_RENDER_H
#include <string>
#include <vector>
#include <Standard_Handle.hxx>
#include <AIS_InteractiveContext.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
#include <OpenGl_GraphicDriver.hxx>
#include <AIS_Shape.hxx>
#include <STEPControl_Reader.hxx>
#include <TopoDS_Shape.hxx>
#include <Graphic3d_GraphicDriver.hxx>
#include <Aspect_DisplayConnection.hxx>
#include <Message.hxx>
#include <Quantity_Color.hxx>
#include <gp_Quaternion.hxx>
#include <OpenGl_Window.hxx>
#include <gp_EulerSequence.hxx>
#include <Aspect_Handle.hxx>
#include <ace/xcomponent/native_interface_xcomponent.h>
#include "common.h"
#include <EGL/egl.h>
#include "EGLCore.h"
class Aspect_Window;
class gp_Quaternion;
class Graphic3d_Camera;
namespace NativeOpenCAX {
class NativeRender {
public:
NativeRender();
~NativeRender();
bool init(int width, int height,EGLCore* eglCore);
bool loadModel(const std::string& filePath);
void loadDefaultModel();
void render();
void resize(int width, int height);
void setRotation(float xAngle, float yAngle);
void resetView();
void setClearColor(float r, float g, float b, float a);
void setZoomLevel(float zoom);
void setTranslation(float x, float y);
private:
void initViewer();
void initContext();
void initView();
void initTextStyle();
// Bind existing EGL display/context to OCCT OpenGl driver
//void loadDefaultModel();
EGLCore* eglCore_;
Handle(OpenGl_GraphicDriver) graphicDriver_;
Handle(V3d_Viewer) viewer_;
Handle(V3d_View) view_;
Handle(AIS_InteractiveContext) context_;
Handle(Prs3d_TextAspect) text_;
std::vector<Handle(AIS_Shape)> shapes_;
float rotationX_;
float rotationY_;
float zoomLevel_;
int width_;
int height_;
float translationX_;
float translationY_;
Quantity_Color clearColor_;
};
} // namespace NativeRender
#endif // NATIVE_RENDER_H