xref: /aoo41x/main/svx/inc/svx/float3d.hxx (revision 3334a7e6)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SVX_FLOAT3D_HXX
25cdf0e10cSrcweir #define _SVX_FLOAT3D_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx>
28cdf0e10cSrcweir #ifndef _FIXED_HXX //autogen
29cdf0e10cSrcweir #include <vcl/fixed.hxx>
30cdf0e10cSrcweir #endif
31cdf0e10cSrcweir #ifndef _FIELD_HXX //autogen
32cdf0e10cSrcweir #include <vcl/field.hxx>
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir #include <sfx2/dockwin.hxx>
35cdf0e10cSrcweir #ifndef _IMAGEBTN_HXX //autogen
36cdf0e10cSrcweir #include <vcl/button.hxx>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #include <svtools/valueset.hxx>
39cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
40cdf0e10cSrcweir #include "svx/svxdllapi.h"
41cdf0e10cSrcweir 
42cdf0e10cSrcweir #include <svx/f3dchild.hxx>
43cdf0e10cSrcweir #include <svx/dlgctl3d.hxx>
44cdf0e10cSrcweir #include <svx/dlgctrl.hxx>
45cdf0e10cSrcweir #include <svx/svdmodel.hxx>
46cdf0e10cSrcweir 
47cdf0e10cSrcweir enum ViewType3D
48cdf0e10cSrcweir {
49cdf0e10cSrcweir 	VIEWTYPE_GEO = 1,
50cdf0e10cSrcweir 	VIEWTYPE_REPRESENTATION,
51cdf0e10cSrcweir 	VIEWTYPE_LIGHT,
52cdf0e10cSrcweir 	VIEWTYPE_TEXTURE,
53cdf0e10cSrcweir 	VIEWTYPE_MATERIAL
54cdf0e10cSrcweir };
55cdf0e10cSrcweir 
56cdf0e10cSrcweir class SdrModel;
57cdf0e10cSrcweir class FmFormModel;
58cdf0e10cSrcweir class FmFormPage;
59cdf0e10cSrcweir class VirtualDevice;
60cdf0e10cSrcweir class E3dView;
61cdf0e10cSrcweir class SdrPageView;
62cdf0e10cSrcweir class Svx3DCtrlItem;
63cdf0e10cSrcweir class SvxConvertTo3DItem;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir //------------------------------------------------------------------------
66cdf0e10cSrcweir struct Svx3DWinImpl;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir class SVX_DLLPUBLIC Svx3DWin : public SfxDockingWindow
69cdf0e10cSrcweir {
70cdf0e10cSrcweir 	friend class		Svx3DChildWindow;
71cdf0e10cSrcweir 	friend class		Svx3DCtrlItem;
72cdf0e10cSrcweir 	using Window::Update;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir private:
75cdf0e10cSrcweir 	ImageButton			aBtnGeo;
76cdf0e10cSrcweir 	ImageButton			aBtnRepresentation;
77cdf0e10cSrcweir 	ImageButton			aBtnLight;
78cdf0e10cSrcweir 	ImageButton			aBtnTexture;
79cdf0e10cSrcweir 	ImageButton			aBtnMaterial;
80cdf0e10cSrcweir 	ImageButton			aBtnUpdate;
81cdf0e10cSrcweir 	ImageButton			aBtnAssign;
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 	FixedLine           aFLGeometrie;
84cdf0e10cSrcweir // Geometrie
85cdf0e10cSrcweir 	FixedText			aFtPercentDiagonal;
86cdf0e10cSrcweir 	MetricField			aMtrPercentDiagonal;
87cdf0e10cSrcweir 	FixedText			aFtBackscale;
88cdf0e10cSrcweir 	MetricField			aMtrBackscale;
89cdf0e10cSrcweir 	FixedText			aFtEndAngle;
90cdf0e10cSrcweir 	MetricField			aMtrEndAngle;
91cdf0e10cSrcweir 	FixedText			aFtDepth;
92cdf0e10cSrcweir 	MetricField			aMtrDepth;
93cdf0e10cSrcweir       FixedLine           aFLSegments;
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 	FixedText			aFtHorizontal;
96cdf0e10cSrcweir 	NumericField		aNumHorizontal;
97cdf0e10cSrcweir 	FixedText			aFtVertical;
98cdf0e10cSrcweir 	NumericField		aNumVertical;
99cdf0e10cSrcweir        FixedLine           aFLNormals;
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 	ImageButton			aBtnNormalsObj;
102cdf0e10cSrcweir 	ImageButton			aBtnNormalsFlat;
103cdf0e10cSrcweir 	ImageButton			aBtnNormalsSphere;
104cdf0e10cSrcweir 	ImageButton			aBtnNormalsInvert;
105cdf0e10cSrcweir 	ImageButton			aBtnTwoSidedLighting;
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	ImageButton			aBtnDoubleSided;
108cdf0e10cSrcweir 	FixedLine           aFLRepresentation;
109cdf0e10cSrcweir // Darstellung
110cdf0e10cSrcweir 	FixedText			aFtShademode;
111cdf0e10cSrcweir 	ListBox				aLbShademode;
112cdf0e10cSrcweir 	FixedLine           aFLShadow;
113cdf0e10cSrcweir 	ImageButton			aBtnShadow3d;
114cdf0e10cSrcweir 	FixedText			aFtSlant;
115cdf0e10cSrcweir 	MetricField			aMtrSlant;
116cdf0e10cSrcweir 	FixedText			aFtDistance;
117cdf0e10cSrcweir 	MetricField			aMtrDistance;
118cdf0e10cSrcweir 	FixedText			aFtFocalLeng;
119cdf0e10cSrcweir 	MetricField			aMtrFocalLength;
120cdf0e10cSrcweir     FixedLine           aFLCamera;
121cdf0e10cSrcweir 	FixedLine           aFLLight;
122cdf0e10cSrcweir 
123cdf0e10cSrcweir // Beleuchtung
124cdf0e10cSrcweir 	ImageButton			aBtnLight1;
125cdf0e10cSrcweir 	ImageButton			aBtnLight2;
126cdf0e10cSrcweir 	ImageButton			aBtnLight3;
127cdf0e10cSrcweir 	ImageButton			aBtnLight4;
128cdf0e10cSrcweir 	ImageButton			aBtnLight5;
129cdf0e10cSrcweir 	ImageButton			aBtnLight6;
130cdf0e10cSrcweir 	ImageButton			aBtnLight7;
131cdf0e10cSrcweir 	ImageButton			aBtnLight8;
132cdf0e10cSrcweir     FixedText           aFTLightsource;
133cdf0e10cSrcweir 	ColorLB				aLbLight1;
134cdf0e10cSrcweir 	ColorLB				aLbLight2;
135cdf0e10cSrcweir 	ColorLB				aLbLight3;
136cdf0e10cSrcweir 	ColorLB				aLbLight4;
137cdf0e10cSrcweir 	ColorLB				aLbLight5;
138cdf0e10cSrcweir 	ColorLB				aLbLight6;
139cdf0e10cSrcweir 	ColorLB				aLbLight7;
140cdf0e10cSrcweir 	ColorLB				aLbLight8;
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 	ImageButton			aBtnLightColor;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 	// #99694# Keyboard shortcuts activate the next control, so the
145cdf0e10cSrcweir 	// order needed to be changed here
146cdf0e10cSrcweir     FixedText           aFTAmbientlight;	// Text label
147cdf0e10cSrcweir 	ColorLB				aLbAmbientlight;	// ListBox
148cdf0e10cSrcweir 	ImageButton			aBtnAmbientColor;	// color button
149cdf0e10cSrcweir 
150cdf0e10cSrcweir        FixedLine           aFLTexture;
151cdf0e10cSrcweir 
152cdf0e10cSrcweir // Texturen
153cdf0e10cSrcweir 	FixedText			aFtTexKind;
154cdf0e10cSrcweir 	ImageButton			aBtnTexLuminance;
155cdf0e10cSrcweir 	ImageButton			aBtnTexColor;
156cdf0e10cSrcweir 	FixedText			aFtTexMode;
157cdf0e10cSrcweir 	ImageButton			aBtnTexReplace;
158cdf0e10cSrcweir 	ImageButton			aBtnTexModulate;
159cdf0e10cSrcweir 	ImageButton			aBtnTexBlend;
160cdf0e10cSrcweir 	FixedText			aFtTexProjectionX;
161cdf0e10cSrcweir 	ImageButton			aBtnTexObjectX;
162cdf0e10cSrcweir 	ImageButton			aBtnTexParallelX;
163cdf0e10cSrcweir 	ImageButton			aBtnTexCircleX;
164cdf0e10cSrcweir 	FixedText			aFtTexProjectionY;
165cdf0e10cSrcweir 	ImageButton			aBtnTexObjectY;
166cdf0e10cSrcweir 	ImageButton			aBtnTexParallelY;
167cdf0e10cSrcweir 	ImageButton			aBtnTexCircleY;
168cdf0e10cSrcweir 	FixedText			aFtTexFilter;
169cdf0e10cSrcweir 	ImageButton			aBtnTexFilter;
170cdf0e10cSrcweir 
171cdf0e10cSrcweir // Material
172cdf0e10cSrcweir        FixedLine           aFLMaterial;
173cdf0e10cSrcweir // Materialeditor
174cdf0e10cSrcweir 	FixedText			aFtMatFavorites;
175cdf0e10cSrcweir 	ListBox  			aLbMatFavorites;
176cdf0e10cSrcweir 	FixedText			aFtMatColor;
177cdf0e10cSrcweir 	ColorLB				aLbMatColor;
178cdf0e10cSrcweir 	ImageButton			aBtnMatColor;
179cdf0e10cSrcweir 	FixedText			aFtMatEmission;
180cdf0e10cSrcweir 	ColorLB				aLbMatEmission;
181cdf0e10cSrcweir 	ImageButton			aBtnEmissionColor;
182cdf0e10cSrcweir        FixedLine           aFLMatSpecular;
183cdf0e10cSrcweir 	FixedText			aFtMatSpecular;
184cdf0e10cSrcweir 	ColorLB				aLbMatSpecular;
185cdf0e10cSrcweir 	ImageButton			aBtnSpecularColor;
186cdf0e10cSrcweir 	FixedText			aFtMatSpecularIntensity;
187cdf0e10cSrcweir 	MetricField			aMtrMatSpecularIntensity;
188cdf0e10cSrcweir 
189cdf0e10cSrcweir 	Svx3DPreviewControl	aCtlPreview;
190cdf0e10cSrcweir 	SvxLightCtl3D		aCtlLightPreview;
191cdf0e10cSrcweir 
192cdf0e10cSrcweir // Unterer Teil
193cdf0e10cSrcweir 	ImageButton			aBtnConvertTo3D;
194cdf0e10cSrcweir 	ImageButton			aBtnLatheObject;
195cdf0e10cSrcweir 	ImageButton			aBtnPerspective;
196cdf0e10cSrcweir 
197cdf0e10cSrcweir // der Rest ...
198cdf0e10cSrcweir 	Image				aImgLightOn;
199cdf0e10cSrcweir 	Image				aImgLightOff;
200cdf0e10cSrcweir 	sal_Bool				bUpdate;
201cdf0e10cSrcweir 	ViewType3D			eViewType;
202cdf0e10cSrcweir 	Size				aSize;
203cdf0e10cSrcweir 
204cdf0e10cSrcweir 	// Model, Page, View etc. fuer Favoriten
205cdf0e10cSrcweir 	FmFormModel*		pModel;
206cdf0e10cSrcweir 	FmFormPage*			pFmPage;
207cdf0e10cSrcweir 	VirtualDevice*		pVDev;
208cdf0e10cSrcweir 	E3dView*			p3DView;
209cdf0e10cSrcweir 	List*				pFavorSetList;
210cdf0e10cSrcweir 	List*				pMatFavSetList;
211cdf0e10cSrcweir 
212cdf0e10cSrcweir 	SfxBindings*				pBindings;
213cdf0e10cSrcweir 	Svx3DCtrlItem*				pControllerItem;
214cdf0e10cSrcweir 
215cdf0e10cSrcweir 	SvxConvertTo3DItem*			pConvertTo3DItem;
216cdf0e10cSrcweir 	SvxConvertTo3DItem*			pConvertTo3DLatheItem;
217cdf0e10cSrcweir 
218cdf0e10cSrcweir 	Svx3DWinImpl*		mpImpl;
219cdf0e10cSrcweir 	SfxMapUnit          ePoolUnit;
220cdf0e10cSrcweir 	FieldUnit           eFUnit;
221cdf0e10cSrcweir 
222cdf0e10cSrcweir 	// ItemSet used to remember set 2d attributes
223cdf0e10cSrcweir 	SfxItemSet*			mpRemember2DAttributes;
224cdf0e10cSrcweir 
225cdf0e10cSrcweir 	sal_Bool				bOnly3DChanged;
226cdf0e10cSrcweir 
227cdf0e10cSrcweir 	//------------------------------------
228cdf0e10cSrcweir 
229cdf0e10cSrcweir 	DECL_LINK( ClickViewTypeHdl, void * );
230cdf0e10cSrcweir 	DECL_LINK( ClickUpdateHdl, void * );
231cdf0e10cSrcweir 	DECL_LINK( ClickAssignHdl, void * );
232cdf0e10cSrcweir 	DECL_LINK( ClickHdl, PushButton * );
233cdf0e10cSrcweir 	DECL_LINK( ClickColorHdl, PushButton * );
234cdf0e10cSrcweir 	DECL_LINK( SelectHdl, void * );
235cdf0e10cSrcweir 	DECL_LINK( ModifyHdl, void * );
236cdf0e10cSrcweir 	DECL_LINK( ClickLightHdl, PushButton * );
237cdf0e10cSrcweir 
238cdf0e10cSrcweir 	DECL_LINK( DoubleClickHdl, void * );
239cdf0e10cSrcweir 
240cdf0e10cSrcweir 	DECL_LINK( ChangeLightCallbackHdl, void * );
241cdf0e10cSrcweir 	DECL_LINK( ChangeSelectionCallbackHdl, void * );
242cdf0e10cSrcweir 
243cdf0e10cSrcweir 	SVX_DLLPRIVATE void			Construct();
244cdf0e10cSrcweir 	SVX_DLLPRIVATE void			Reset();
245cdf0e10cSrcweir 
246cdf0e10cSrcweir 	SVX_DLLPRIVATE sal_Bool			LBSelectColor( ColorLB* pLb, const Color& rColor );
247cdf0e10cSrcweir 	SVX_DLLPRIVATE sal_uInt16			GetLightSource( const PushButton* pBtn = NULL );
248cdf0e10cSrcweir 	SVX_DLLPRIVATE ColorLB*		GetLbByButton( const PushButton* pBtn = NULL );
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 	SVX_DLLPRIVATE bool			GetUILightState( ImageButton& aBtn ) const;
251cdf0e10cSrcweir 	SVX_DLLPRIVATE void			SetUILightState( ImageButton& aBtn, bool bState );
252cdf0e10cSrcweir 
253cdf0e10cSrcweir protected:
254cdf0e10cSrcweir 	virtual void	Resize();
255cdf0e10cSrcweir 
256cdf0e10cSrcweir public:
257cdf0e10cSrcweir 			Svx3DWin( SfxBindings* pBindings, SfxChildWindow *pCW,
258cdf0e10cSrcweir 						Window* pParent );
259cdf0e10cSrcweir 			~Svx3DWin();
260cdf0e10cSrcweir 
261cdf0e10cSrcweir 	void	InitColorLB( const SdrModel* pDoc );
IsUpdateMode() const262cdf0e10cSrcweir 	sal_Bool	IsUpdateMode() const { return bUpdate; }
263cdf0e10cSrcweir 
264cdf0e10cSrcweir 	void	Update( SfxItemSet& rSet );
265cdf0e10cSrcweir 	void	GetAttr( SfxItemSet& rSet );
266cdf0e10cSrcweir 
267cdf0e10cSrcweir 	void UpdatePreview(); // nach oben (private)
268cdf0e10cSrcweir 	void DocumentReload(); // #83951#
269cdf0e10cSrcweir };
270cdf0e10cSrcweir 
271cdf0e10cSrcweir /*************************************************************************
272cdf0e10cSrcweir |*
273cdf0e10cSrcweir |* ControllerItem fuer 3D-Window (Floating/Docking)
274cdf0e10cSrcweir |*
275cdf0e10cSrcweir \************************************************************************/
276cdf0e10cSrcweir 
277cdf0e10cSrcweir class Svx3DCtrlItem : public SfxControllerItem
278cdf0e10cSrcweir {
279cdf0e10cSrcweir 	Svx3DWin* p3DWin;
280cdf0e10cSrcweir 
281cdf0e10cSrcweir  protected:
282cdf0e10cSrcweir 	virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
283cdf0e10cSrcweir 								const SfxPoolItem* pState );
284cdf0e10cSrcweir 
285cdf0e10cSrcweir  public:
286cdf0e10cSrcweir 	Svx3DCtrlItem( sal_uInt16, Svx3DWin*, SfxBindings* );
287cdf0e10cSrcweir };
288cdf0e10cSrcweir 
289cdf0e10cSrcweir /*************************************************************************
290cdf0e10cSrcweir |*
291cdf0e10cSrcweir |* ControllerItem fuer Status eines Slots
292cdf0e10cSrcweir |* (SID_CONVERT_TO_3D, SID_CONVERT_TO_3D_LATHE_FAST)
293cdf0e10cSrcweir |*
294cdf0e10cSrcweir \************************************************************************/
295cdf0e10cSrcweir 
296cdf0e10cSrcweir class SvxConvertTo3DItem : public SfxControllerItem
297cdf0e10cSrcweir {
298cdf0e10cSrcweir 	sal_Bool						bState;
299cdf0e10cSrcweir 
300cdf0e10cSrcweir protected:
301cdf0e10cSrcweir 	virtual void StateChanged(sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pState);
302cdf0e10cSrcweir 
303cdf0e10cSrcweir public:
304cdf0e10cSrcweir 	SvxConvertTo3DItem(sal_uInt16 nId, SfxBindings* pBindings);
GetState() const305cdf0e10cSrcweir 	sal_Bool GetState() const { return bState; }
306cdf0e10cSrcweir };
307cdf0e10cSrcweir 
308cdf0e10cSrcweir #endif		// _SVX_FLOAT3D_HXX
309cdf0e10cSrcweir 
310