Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
DynamicExchangeWindow.h
1#if !defined(DYNAMICEXCHANGEWINDOW_H)
2#define DYNAMICEXCHANGEWINDOW_H
3
4#ifdef _MSC_VER
5#pragma once
6#endif // _MSC_VER
7
8#include "DynamicExchangeCommon.h"
9
10BEGIN_MOOTOOLS_NAMESPACE
11
12DLL_3DFUNCTION bool SendInfoToWnd(CXWinWnd *pSrCXWnd, CXWinWnd *pDstWnd, unsigned int action, const void *data, fileuint size, bool activate);
13DLL_3DFUNCTION bool SendFileToWnd(HWND hSrCXWnd, CCustomMemFile& file, const CXString& wndName, unsigned int action, bool activate, HWND hWnd = NULL);
14
15// define MOOTOOLS_NO_DYNSERVER_CLASS if you don't need a complete support from a client application
16class DLL_3DFUNCTION CDynExchangeWindow : public CXWinWnd
17{
18public:
19 CDynExchangeWindow();
20 virtual ~CDynExchangeWindow();
21
22 bool Create(const CXString& clientClassName, const CXString& serverClassName); // Creates the windows handle
23
24 bool SendMessageData(unsigned int message, const unsigned char *data = NULL, fileuint dataSize = 0, const CCustomData *additionalData = NULL, HWND specificHWnd = NULL); // Send any kind of data. data and/or additionalData can be NULL.
25
26 // send information
27 // additionalCustomData can be used to define a specific value between the caller and the client.
28 // For example you can pass a DYNAMICDATA_3DSOFTWARE that will allow to filter only data from a specific software.
29#ifndef MOOTOOLS_NO_DYN3D
30 bool SendScene(C3DScene *scene, bool deleteIt, const CCustomData *additionalCustomData = NULL, HWND specificHWnd = NULL); // Send a scene to an external application. If the scene is temporary, using deleteIt = true, is a good idea, so it is deleted before sending it to the external application (this limit memory consumption)
31 bool SendNode(C3DSceneNode *node, bool skipGeom = false, const CCustomData *additionalCustomData = NULL); // If skipGeom is true, then only the node (without the geometry) is sent.
32 bool SendNodes(C3DScene *scene, const C3DNodeArray& nodes, const CBitArray *skipGeoms = NULL, const CCustomData *additionalCustomData = NULL);
33#endif
34
35#if !defined(MOOTOOLS_NO_DYNBITMAP) && !defined(MOOTOOLS_NO_BITMAP)
37#endif
38
39 // Receive information
40#ifndef MOOTOOLS_NO_DYNBITMAP
41 virtual void ReceiveBitmap(const CXString& filename, CBitmap *bitmap, bool asAlpha) {};
42#endif
43
44#ifndef MOOTOOLS_NO_DYN3D
45 virtual bool ReceiveScene(C3DScene *scene, const CCustomData *additionalData = NULL) const { return false; } // Receive a scene from software. The receiver is owner of the scene if it return true and then should delete it if needed. If the receiver return false, it can't handle the scene and the caller will delete it
46 virtual bool ReceiveNode(C3DSceneNode *node, const CCustomData *additionalData = NULL) const { return false; } // Receive a node
47 virtual bool ReceiveNodes(C3DNodeArray& nodes, const CCustomData *additionalData = NULL) const { return false; } // Receive several nodes
48#endif
49
50 virtual bool ReceiveMessageData(unsigned int message, const unsigned char *data, fileuint dataSize, const CCustomData *additionalData = NULL) { return false; } // Received private data. The receiver is the owner of the data, it return true. It then should delete the data using xDeallocateArray. If the method return false, then the data is automatically freed
51
52 protected:
53 CXString clientClass; // The class of the external application
54 CXString serverClass; // The class of our application (ie 3DBrowser)
55
56#ifndef MOOTOOLS_NO_DYN3D
57 C3DScene *ReceiveScene(const unsigned char *data, unsigned int dataSize, const CCustomData& additionalData);
58#endif
59
60 virtual LPCTSTR GetClass() = 0;
61 virtual LPCTSTR GetDestClass() = 0;
62 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
63 BOOL OnCopyData(CXWinWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
64 void PumpMessages();
65};
66
67class DLL_3DFUNCTION CDynServerWindow : public CDynExchangeWindow
68{
69// Construction
70public:
71 CDynServerWindow();
72 virtual ~CDynServerWindow();
73
74protected:
75 LPCTSTR GetClass() { return serverClass; }
76 LPCTSTR GetDestClass() { return clientClass; }
77 BOOL OnCopyData(CXWinWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
78
79#ifdef MOOTOOLS_MFC_PRODUCT_BUILD
81#endif
82};
83
84class DLL_3DFUNCTION CDynClientWindow : public CDynExchangeWindow
85{
86// Construction
87public:
88 CDynClientWindow();
89 virtual ~CDynClientWindow();
90
91 #ifndef MOOTOOLS_NO_DYN3D
92 #ifdef MOOTOOLS_MFC_PRODUCT_BUILD
93 protected:
94 unsigned int lock;
95
96 public:
97 virtual void BeginSceneScan() {};
98 virtual void EndSceneScan() {};
99 virtual void ReceiveScene(const CXString& filename, C3DScene *scene, bool updateMode, bool silentMode) {};
100 virtual C3DScene *ReadScene(const CXString& filename, bool updateMode, bool silentMode) { return NULL; };
101 #endif
102 #endif
103
104// Overrides
105 protected:
106 LPCTSTR GetClass() { return clientClass; }
107 LPCTSTR GetDestClass() { return serverClass; }
108 BOOL OnCopyData(CXWinWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
109
110 // Generated message map functions
111protected:
112#ifdef MOOTOOLS_MFC_PRODUCT_BUILD
114#endif
115};
116
117END_MOOTOOLS_NAMESPACE
118
119#endif // !defined(DYNAMICEXCHANGEWINDOW_H)
The class allows to get access to the scene graph, node hierarchy, material.
Definition 3DScene.h:306
A node matches one element that is part of the C3DScene graph. It references a C3DBaseObject and has ...
Definition 3DSceneNode.h:64
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27
CBitArray class for handling array of bits.
Definition BitArray.h:18
CCustomData is a handly class for storing any kind of data.
Definition CustomData.h:106
Definition CustomMemFile.h:15