You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.0 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef XJ_COMPOSITE_OSG_VIEW_H
#define XJ_COMPOSITE_OSG_VIEW_H
#include "dllExport.h"
#include "Common.h"
#include "XJObjectManager/XJObject.h"
#include <vector>
class XJOSGVIEWEXPORT CXJCompositeOSGView
{
public:
CXJCompositeOSGView();
virtual ~CXJCompositeOSGView();
void AddOSGView(int index,void* hwnd);
static void Render(void* ptr);
//static void Render();
//根据传入的对象指针,来创建并更新视图对象,默认为更新对象的所有属性
int UpdateObjectView(int index,CXJObject* obj, EOSGUpdateType updateType = UPDATE_ALL);
//将网格截骨,并显示出截骨后的封闭面
void ClipPlaneList(int index, CXJObject *pobj, std::vector<CXJPlane*> Planes, bool IsClosed = true);
void StopClipPlane(int index, CXJObject *pobj);
//用平面将网格显示成两部分,两部分用不同颜色显示
void SplitObjectByClipPlane(int index, CXJObject *obj, vector<CXJPlane*> Planes, int clipIndex);
void StopSplitObject(int index, CXJObject *obj);
//读取可执行文件路径
void SetModeulePath(std::string a_exePath) {m_exePath = a_exePath;}
//设置投影视图(左、右视图等三视图)
void SetProjView(int index,XJViewType viewType);
//自适应视图显示
void ZoomView(int index);
//对象的旋转操作
void RotateObject(int index, CXJObject* obj, Point3D basePt, Point3D rotateDir, float angle);
//对象变换,不连续变换,只变换一次,绕着基点,从一个轴变换到另一个轴
void TransformObjectOnce(int index, CXJObject* obj, Point3D originPt, Point3D oriVec, Point3D destVec);
void GetObjectMatrix(int index, CXJObject* obj, Matrix4& matrix) const;
//删除所有的osg对象
void DeleteAllOSGObjects(int index);
//设置视图三个角上的Text displayPos为显示文字位置
//0---左上角显示, 1--右上角显示, 2--左下角显示
void setHUDText(int index, wchar_t* str, HUDTextWinPos displayPos = WINDOW_LEFT_TOP_POS, AlignmentType alighment = BASE_LINE_ALIGNMENT);
//设置text的属性值包括大小颜色字体等
void setHUDTextProperties(int index, float textSize, COLORREF textColor, std::string& font);
private:
void* m_CompositeViewer;
void* m_graphicContext;
std::vector<void*> m_osgInternals;
std::string m_exePath;
};
#endif