diff options
author | Albert Thuswaldner <albert.thuswaldner@gmail.com> | 2011-04-07 15:47:21 +0300 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@novell.com> | 2011-04-07 15:49:17 +0300 |
commit | 265a8353a0bd75c9416110b4a27bbff45c0491d5 (patch) | |
tree | c561cb668bb4a6c62aa746a07aae19dfcc129aa7 /svx | |
parent | 7074b7b7be105cccb6a914860814b4a98ebfdcaf (diff) |
Translation of German comments
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/engine3d/camera3d.cxx | 29 | ||||
-rw-r--r-- | svx/source/engine3d/cube3d.cxx | 47 | ||||
-rw-r--r-- | svx/source/engine3d/deflt3d.cxx | 17 | ||||
-rw-r--r-- | svx/source/engine3d/dragmt3d.cxx | 120 | ||||
-rw-r--r-- | svx/source/engine3d/e3dundo.cxx | 78 | ||||
-rw-r--r-- | svx/source/engine3d/extrud3d.cxx | 47 | ||||
-rw-r--r-- | svx/source/engine3d/float3d.cxx | 361 | ||||
-rw-r--r-- | svx/source/engine3d/float3d.src | 10 | ||||
-rw-r--r-- | svx/source/engine3d/lathe3d.cxx | 69 | ||||
-rw-r--r-- | svx/source/engine3d/obj3d.cxx | 398 | ||||
-rw-r--r-- | svx/source/engine3d/objfac3d.cxx | 27 | ||||
-rw-r--r-- | svx/source/engine3d/polygn3d.cxx | 142 | ||||
-rw-r--r-- | svx/source/engine3d/polysc3d.cxx | 6 | ||||
-rw-r--r-- | svx/source/engine3d/scene3d.cxx | 248 | ||||
-rw-r--r-- | svx/source/engine3d/sphere3d.cxx | 78 | ||||
-rw-r--r-- | svx/source/engine3d/string3d.src | 2 | ||||
-rw-r--r-- | svx/source/engine3d/view3d.cxx | 334 | ||||
-rw-r--r-- | svx/source/engine3d/view3d1.cxx | 37 | ||||
-rw-r--r-- | svx/source/engine3d/viewpt3d2.cxx | 140 |
19 files changed, 594 insertions, 1596 deletions
diff --git a/svx/source/engine3d/camera3d.cxx b/svx/source/engine3d/camera3d.cxx index 823c0d259642..e353c2623c1c 100644 --- a/svx/source/engine3d/camera3d.cxx +++ b/svx/source/engine3d/camera3d.cxx @@ -136,12 +136,12 @@ void Camera3D::SetBankAngle(double fAngle) } } - // von aDiff nach oben zeigenden View-Up-Vektor berechnen + // Calculate from aDiff to uppwards pointing View-Up-Vector aPrj = aPrj.getPerpendicular(aDiff); aPrj = aPrj.getPerpendicular(aDiff); aDiff.normalize(); - // auf Z-Achse rotieren, dort um BankAngle drehen und zurueck + // Rotate on Z axis, to rotate the BankAngle and back basegfx::B3DHomMatrix aTf; const double fV(sqrt(aDiff.getY() * aDiff.getY() + aDiff.getZ() * aDiff.getZ())); @@ -204,12 +204,6 @@ void Camera3D::SetBankAngle(double fAngle) SetVUV(aTf * aPrj); } -/************************************************************************* -|* -|* Brennweite setzen -|* -\************************************************************************/ - void Camera3D::SetFocalLength(double fLen) { if ( fLen < 5 ) @@ -218,11 +212,7 @@ void Camera3D::SetFocalLength(double fLen) fFocalLength = fLen; } -/************************************************************************* -|* -|* Um die Kameraposition drehen, LookAt wird dabei veraendert -|* -\************************************************************************/ +// To rotate the camera position, this changes LookAt void Camera3D::Rotate(double fHAngle, double fVAngle) { @@ -270,12 +260,7 @@ void Camera3D::Rotate(double fHAngle, double fVAngle) SetLookAt(aPosition + aDiff); } - -/************************************************************************* -|* -|* Um den Blickpunkt drehen, Position wird dabei veraendert -|* -\************************************************************************/ +// To rotate the view point, this changes the position void Camera3D::RotateAroundLookAt(double fHAngle, double fVAngle) { @@ -323,11 +308,7 @@ void Camera3D::RotateAroundLookAt(double fHAngle, double fVAngle) SetPosition(aLookAt + aDiff); } -/************************************************************************* -|* -|* FG: ??? Setzt wohl die Projektionsebene in eine bestimmte Tiefe -|* -\************************************************************************/ +// ??? this probably sets the projection plane in a certain depth void Camera3D::SetFocalLengthWithCorrect(double fLen) { diff --git a/svx/source/engine3d/cube3d.cxx b/svx/source/engine3d/cube3d.cxx index ee35d1e221b1..46feb2ded38f 100644 --- a/svx/source/engine3d/cube3d.cxx +++ b/svx/source/engine3d/cube3d.cxx @@ -38,7 +38,7 @@ #include <svx/sdr/contact/viewcontactofe3dcube.hxx> ////////////////////////////////////////////////////////////////////////////// -// #110094# DrawContact section +// DrawContact section sdr::contact::ViewContact* E3dCubeObj::CreateObjectSpecificViewContact() { @@ -47,29 +47,20 @@ sdr::contact::ViewContact* E3dCubeObj::CreateObjectSpecificViewContact() TYPEINIT1(E3dCubeObj, E3dCompoundObject); -/************************************************************************* -|* -|* Konstruktor: | -|* 3D-Quader erzeugen; aPos: Zentrum oder links, unten, hinten |__ -|* (abhaengig von bPosIsCenter) / -|* -\************************************************************************/ - E3dCubeObj::E3dCubeObj(E3dDefaultAttributes& rDefault, basegfx::B3DPoint aPos, const basegfx::B3DVector& r3DSize) : E3dCompoundObject(rDefault) { - // Defaults setzen + // Set Defaults SetDefaultAttributes(rDefault); - // uebergebene drueberbuegeln - aCubePos = aPos; + aCubePos = aPos; // position centre or left, bottom, back (dependant on bPosIsCenter) aCubeSize = r3DSize; } E3dCubeObj::E3dCubeObj() : E3dCompoundObject() { - // Defaults setzen + // Set Defaults E3dDefaultAttributes aDefault; SetDefaultAttributes(aDefault); } @@ -82,22 +73,12 @@ void E3dCubeObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault) bPosIsCenter = rDefault.GetDefaultCubePosIsCenter(); } -/************************************************************************* -|* -|* Identifier zurueckgeben -|* -\************************************************************************/ - sal_uInt16 E3dCubeObj::GetObjIdentifier() const { return E3D_CUBEOBJ_ID; } -/************************************************************************* -|* -|* Wandle das Objekt in ein Gruppenobjekt bestehend aus 6 Polygonen -|* -\************************************************************************/ +// Convert the object into a group object consisting of 6 polygons SdrObject *E3dCubeObj::DoConvertToPolyObj(sal_Bool /*bBezier*/) const { @@ -109,11 +90,7 @@ E3dCubeObj* E3dCubeObj::Clone() const return CloneHelper< E3dCubeObj >(); } -/************************************************************************* -|* -|* Lokale Parameter setzen mit Geometrieneuerzeugung -|* -\************************************************************************/ +// Set local parameters with geometry re-creating void E3dCubeObj::SetCubePos(const basegfx::B3DPoint& rNew) { @@ -151,11 +128,7 @@ void E3dCubeObj::SetSideFlags(sal_uInt16 nNew) } } -/************************************************************************* -|* -|* Get the name of the object (singular) -|* -\************************************************************************/ +// Get the name of the object (singular) void E3dCubeObj::TakeObjNameSingul(XubString& rName) const { @@ -171,11 +144,7 @@ void E3dCubeObj::TakeObjNameSingul(XubString& rName) const } } -/************************************************************************* -|* -|* Get the name of the object (plural) -|* -\************************************************************************/ +// Get the name of the object (plural) void E3dCubeObj::TakeObjNamePlural(XubString& rName) const { diff --git a/svx/source/engine3d/deflt3d.cxx b/svx/source/engine3d/deflt3d.cxx index adf41573e67d..7ab3bf792481 100644 --- a/svx/source/engine3d/deflt3d.cxx +++ b/svx/source/engine3d/deflt3d.cxx @@ -35,13 +35,8 @@ #include <editeng/colritem.hxx> #include <svx/e3ditem.hxx> -/************************************************************************* -|* -|* Klasse zum verwalten der 3D-Default Attribute -|* -\************************************************************************/ +// Class to manage the 3D default attributes -// Konstruktor E3dDefaultAttributes::E3dDefaultAttributes() { Reset(); @@ -49,21 +44,21 @@ E3dDefaultAttributes::E3dDefaultAttributes() void E3dDefaultAttributes::Reset() { - // Compound-Objekt + // Compound object bDefaultCreateNormals = sal_True; bDefaultCreateTexture = sal_True; - // Cube-Objekt + // Cube object aDefaultCubePos = basegfx::B3DPoint(-500.0, -500.0, -500.0); aDefaultCubeSize = basegfx::B3DVector(1000.0, 1000.0, 1000.0); nDefaultCubeSideFlags = CUBE_FULL; bDefaultCubePosIsCenter = sal_False; - // Sphere-Objekt + // Sphere object aDefaultSphereCenter = basegfx::B3DPoint(0.0, 0.0, 0.0); aDefaultSphereSize = basegfx::B3DPoint(1000.0, 1000.0, 1000.0); - // Lathe-Objekt + // Lathe object nDefaultLatheEndAngle = 3600; bDefaultLatheSmoothed = sal_True; bDefaultLatheSmoothFrontBack = sal_False; @@ -71,7 +66,7 @@ void E3dDefaultAttributes::Reset() bDefaultLatheCloseFront = sal_True; bDefaultLatheCloseBack = sal_True; - // Extrude-Objekt + // Extrude object bDefaultExtrudeSmoothed = sal_True; bDefaultExtrudeSmoothFrontBack = sal_False; bDefaultExtrudeCharacterMode = sal_False; diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx index bb03588e1d53..283d24c42a42 100644 --- a/svx/source/engine3d/dragmt3d.cxx +++ b/svx/source/engine3d/dragmt3d.cxx @@ -48,12 +48,6 @@ TYPEINIT1(E3dDragMethod, SdrDragMethod); -/************************************************************************* -|* -|* Konstruktor aller 3D-DragMethoden -|* -\************************************************************************/ - E3dDragMethod::E3dDragMethod ( SdrDragView &_rView, const SdrMarkList& rMark, @@ -64,8 +58,7 @@ E3dDragMethod::E3dDragMethod ( mbMoveFull(bFull), mbMovedAtAll(sal_False) { - // Fuer alle in der selektion befindlichen 3D-Objekte - // eine Unit anlegen + // Create a unit for all the 3D objects present in the selection const long nCnt(rMark.GetMarkCount()); static bool bDoInvalidate(false); long nObjs(0); @@ -114,8 +107,8 @@ E3dDragMethod::E3dDragMethod ( aNewUnit.maInvDisplayTransform.invert(); } - // SnapRects der beteiligten Objekte invalidieren, um eine - // Neuberechnung beim Setzen der Marker zu erzwingen + // Invalidate SnapRects of the objects involved, to force a + // recalculation for setting the marker if(bDoInvalidate) { pE3dObj->SetRectsDirty(); @@ -129,10 +122,10 @@ E3dDragMethod::E3dDragMethod ( aNewUnit.maWireframePoly.transform(aNewUnit.maTransform); } - // FullBound ermitteln + // Determine FullBound maFullBound.Union(pE3dObj->GetSnapRect()); - // Unit einfuegen + // Insert Unit maGrp.push_back(aNewUnit); } } @@ -146,11 +139,7 @@ void E3dDragMethod::TakeSdrDragComment(XubString& /*rStr*/) const { } -/************************************************************************* -|* -|* Erstelle das Drahtgittermodel fuer alle Aktionen -|* -\************************************************************************/ +// Create the wireframe model for all actions bool E3dDragMethod::BeginSdrDrag() { @@ -179,23 +168,17 @@ bool E3dDragMethod::BeginSdrDrag() return sal_True; } -/************************************************************************* -|* -|* Schluss -|* -\************************************************************************/ - bool E3dDragMethod::EndSdrDrag(bool /*bCopy*/) { const sal_uInt32 nCnt(maGrp.size()); if(!mbMoveFull) { - // WireFrame ausblenden + // Hide wireframe Hide(); } - // Alle Transformationen anwenden und UnDo's anlegen + // Apply all transformations and create undo's if(mbMovedAtAll) { const bool bUndo = getSdrDragView().IsUndoEnabled(); @@ -222,12 +205,6 @@ bool E3dDragMethod::EndSdrDrag(bool /*bCopy*/) return sal_True; } -/************************************************************************* -|* -|* Abbruch -|* -\************************************************************************/ - void E3dDragMethod::CancelSdrDrag() { if(mbMoveFull) @@ -238,7 +215,7 @@ void E3dDragMethod::CancelSdrDrag() for(sal_uInt32 nOb(0); nOb < nCnt; nOb++) { - // Transformation restaurieren + // Restore transformation E3dDragMethodUnit& rCandidate = maGrp[nOb]; E3DModifySceneSnapRectUpdater aUpdater(rCandidate.mp3DObj); rCandidate.mp3DObj->SetTransform(rCandidate.maInitTransform); @@ -247,27 +224,19 @@ void E3dDragMethod::CancelSdrDrag() } else { - // WireFrame ausblenden + // Hide WireFrame Hide(); } } -/************************************************************************* -|* -|* Gemeinsames MoveSdrDrag() -|* -\************************************************************************/ +// Common MoveSdrDrag() void E3dDragMethod::MoveSdrDrag(const Point& /*rPnt*/) { mbMovedAtAll = true; } -/************************************************************************* -|* -|* Zeichne das Drahtgittermodel -|* -\************************************************************************/ +// Draw the wire frame model // for migration from XOR to overlay void E3dDragMethod::CreateOverlayGeometry(::sdr::overlay::OverlayManager& rOverlayManager) @@ -325,7 +294,7 @@ E3dDragRotate::E3dDragRotate(SdrDragView &_rView, sal_Bool bFull) : E3dDragMethod(_rView, rMark, eConstr, bFull) { - // Zentrum aller selektierten Objekte in Augkoordinaten holen + // Get center of all selected objects in eye coordinates const sal_uInt32 nCnt(maGrp.size()); if(nCnt) @@ -347,7 +316,7 @@ E3dDragRotate::E3dDragRotate(SdrDragView &_rView, maGlobalCenter += aObjCenter; } - // Teilen durch Anzahl + // Divide by the number if(nCnt > 1) { maGlobalCenter /= (double)nCnt; @@ -367,19 +336,16 @@ E3dDragRotate::E3dDragRotate(SdrDragView &_rView, aInverseViewToEye.invert(); aRotCenter3D = aInverseViewToEye * aRotCenter3D; - // X,Y des RotCenter und Tiefe der gemeinsamen Objektmitte aus - // Rotationspunkt im Raum benutzen + // Use X,Y of the RotCenter and depth of the common object centre + // as rotation point in the space maGlobalCenter.setX(aRotCenter3D.getX()); maGlobalCenter.setY(aRotCenter3D.getY()); } } } -/************************************************************************* -|* -|* Das Objekt wird bewegt, bestimme die Winkel -|* -\************************************************************************/ + +//The object is moved, determine the angle void E3dDragRotate::MoveSdrDrag(const Point& rPnt) { @@ -388,7 +354,7 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt) if(DragStat().CheckMinMoved(rPnt)) { - // Modifier holen + // Get modifier sal_uInt16 nModifier = 0; if(getSdrDragView().ISA(E3dView)) { @@ -396,12 +362,12 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt) nModifier = rLastMouse.GetModifier(); } - // Alle Objekte rotieren + // Rotate all objects const sal_uInt32 nCnt(maGrp.size()); for(sal_uInt32 nOb(0); nOb < nCnt; nOb++) { - // Rotationswinkel bestimmen + // Determine rotation angle double fWAngle, fHAngle; E3dDragMethodUnit& rCandidate = maGrp[nOb]; @@ -431,11 +397,11 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt) fHAngle = (double)(((long) fHAngle + nSnap/2) / nSnap * nSnap); } - // nach radiant + // to radians fWAngle *= F_PI180; fHAngle *= F_PI180; - // Transformation bestimmen + // Determine transformation basegfx::B3DHomMatrix aRotMat; if(E3DDRAG_CONSTR_Y & meConstraint) { @@ -456,8 +422,7 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt) aRotMat.rotate(fHAngle, 0.0, 0.0); } - // Transformation in Eye-Koordinaten, dort rotieren - // und zurueck + // Transformation in eye coordinates, there rotate then and back const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(rCandidate.mp3DObj->GetScene()->GetViewContact()); const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D()); basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation()); @@ -471,7 +436,7 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt) aTransMat *= aInverseOrientation; aTransMat *= rCandidate.maInvDisplayTransform; - // ...und anwenden + // ...and apply rCandidate.maTransform *= aTransMat; if(mbMoveFull) @@ -500,14 +465,9 @@ Pointer E3dDragRotate::GetSdrDragPointer() const return Pointer(POINTER_ROTATE); } -/************************************************************************* -|* -|* E3dDragMove -|* Diese DragMethod wird nur bei Translationen innerhalb von 3D-Scenen -|* benoetigt. Wird eine 3D-Scene selbst verschoben, so wird diese DragMethod -|* nicht verwendet. -|* -\************************************************************************/ +// E3dDragMove. This drag method is only required for translations inside +// 3D scenes. If a 3D-scene itself moved, then this drag method will drag +// not be used. TYPEINIT1(E3dDragMove, E3dDragMethod); @@ -546,11 +506,11 @@ E3dDragMove::E3dDragMove(SdrDragView &_rView, maScaleFixPos = maFullBound.TopLeft(); break; default: - // Bewegen des Objektes, HDL_MOVE + // Moving the object, HDL_MOVE break; } - // Override wenn IsResizeAtCenter() + // Override when IsResizeAtCenter() if(getSdrDragView().IsResizeAtCenter()) { meWhatDragHdl = HDL_USER; @@ -558,11 +518,7 @@ E3dDragMove::E3dDragMove(SdrDragView &_rView, } } -/************************************************************************* -|* -|* Das Objekt wird bewegt, bestimme die Translation -|* -\************************************************************************/ +// The object is moved, determine the translations void E3dDragMove::MoveSdrDrag(const Point& rPnt) { @@ -574,12 +530,12 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt) if(HDL_MOVE == meWhatDragHdl) { // Translation - // Bewegungsvektor bestimmen + // Determine the motion vector basegfx::B3DPoint aGlobalMoveHead((double)(rPnt.X() - maLastPos.X()), (double)(rPnt.Y() - maLastPos.Y()), 32768.0); basegfx::B3DPoint aGlobalMoveTail(0.0, 0.0, 32768.0); const sal_uInt32 nCnt(maGrp.size()); - // Modifier holen + // Get modifier sal_uInt16 nModifier(0); if(getSdrDragView().ISA(E3dView)) @@ -623,7 +579,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt) aMoveTail3D.setZ(fZwi); } - // Bewegungsvektor von Aug-Koordinaten nach Parent-Koordinaten + // Motion vector from eye coordinates to parent coordinates basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation()); aInverseOrientation.invert(); basegfx::B3DHomMatrix aCompleteTrans(rCandidate.maInvDisplayTransform * aInverseOrientation); @@ -654,8 +610,8 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt) } else { - // Skalierung - // Skalierungsvektor bestimmen + // Scaling + // Determine scaling vector Point aStartPos = DragStat().GetStart(); const sal_uInt32 nCnt(maGrp.size()); @@ -693,7 +649,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt) { case HDL_LEFT: case HDL_RIGHT: - // constrain to auf X -> Y equal + // to constrain on X -> Y equal aScNext.setY(aScFixPos.getY()); break; case HDL_UPPER: @@ -755,7 +711,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt) aNewTrans *= aInverseOrientation; aNewTrans *= rCandidate.maInvDisplayTransform; - // ...und anwenden + // ...and apply rCandidate.maTransform = aNewTrans; if(mbMoveFull) diff --git a/svx/source/engine3d/e3dundo.cxx b/svx/source/engine3d/e3dundo.cxx index 51ce68346940..bacb8b06781b 100644 --- a/svx/source/engine3d/e3dundo.cxx +++ b/svx/source/engine3d/e3dundo.cxx @@ -39,20 +39,12 @@ TYPEINIT1(E3dUndoAction, SfxUndoAction); -/************************************************************************\ -|* -|* Destruktor der Basisklasse -|* -\************************************************************************/ E3dUndoAction::~E3dUndoAction () { } -/************************************************************************\ -|* -|* Repeat gibt es nicht -|* -\************************************************************************/ +// Repeat does not exist + sal_Bool E3dUndoAction::CanRepeat(SfxRepeatTarget&) const { return sal_False; @@ -68,50 +60,30 @@ TYPEINIT1(E3dRotateUndoAction, E3dUndoAction); ************************************************************************/ -/************************************************************************\ -|* -|* Undodestruktor fuer 3D-Rotation -|* -\************************************************************************/ +// Undo destructor for 3D-Rotation + E3dRotateUndoAction::~E3dRotateUndoAction () { } -/************************************************************************\ -|* -|* Undo fuer 3D-Rotation ueber die Rotationsmatrizen -|* -\************************************************************************/ +// Undo for 3D-Rotation on the Rotation matrix + void E3dRotateUndoAction::Undo () { E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj); pMy3DObj->SetTransform(aMyOldRotation); } -/************************************************************************\ -|* -|* Undo fuer 3D-Rotation ueber die Rotationsmatrizen -|* -\************************************************************************/ +// Redo for 3D-Rotation on the Rotation matrix + void E3dRotateUndoAction::Redo () { E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj); pMy3DObj->SetTransform(aMyNewRotation); } -/************************************************************************* -|* -|* E3dAttributesUndoAction -|* -\************************************************************************/ - TYPEINIT1(E3dAttributesUndoAction, SdrUndoAction); -/************************************************************************* -|* -|* Konstruktor -|* -\************************************************************************/ E3dAttributesUndoAction::E3dAttributesUndoAction( SdrModel &rModel, E3dView* p3dView, E3dObject* pInObject, @@ -127,54 +99,34 @@ E3dAttributesUndoAction::E3dAttributesUndoAction( SdrModel &rModel, { } -/************************************************************************* -|* -|* Destruktor -|* -\************************************************************************/ E3dAttributesUndoAction::~E3dAttributesUndoAction() { } -/************************************************************************* -|* -|* Undo() -|* Implementiert ueber Set3DAttributes(), um die Attribute nur an einer -|* Stelle pflegen zu muessen! -|* -\************************************************************************/ +// Undo() implemented through Set3DAttributes() to only maintain the attributes +// in one place + void E3dAttributesUndoAction::Undo() { E3DModifySceneSnapRectUpdater aUpdater(pObject); pObject->SetMergedItemSetAndBroadcast(aOldSet); } -/************************************************************************* -|* -|* Redo() -|* -\************************************************************************/ void E3dAttributesUndoAction::Redo() { E3DModifySceneSnapRectUpdater aUpdater(pObject); pObject->SetMergedItemSetAndBroadcast(aNewSet); } -/************************************************************************* -|* -|* Mehrfaches Undo nicht moeglich -|* -\************************************************************************/ +// Multiple Undo is not possible + sal_Bool E3dAttributesUndoAction::CanRepeat(SfxRepeatTarget& /*rView*/) const { return sal_False; } -/************************************************************************* -|* -|* Mehrfaches Undo nicht moeglich -|* -\************************************************************************/ +// Multiple Undo is not possible + void E3dAttributesUndoAction::Repeat() { } diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx index 6098b1506da1..aa8ba478ea6f 100644 --- a/svx/source/engine3d/extrud3d.cxx +++ b/svx/source/engine3d/extrud3d.cxx @@ -49,7 +49,7 @@ #include <basegfx/polygon/b3dpolypolygontools.hxx> ////////////////////////////////////////////////////////////////////////////// -// #110094# DrawContact section +// DrawContact section sdr::contact::ViewContact* E3dExtrudeObj::CreateObjectSpecificViewContact() { @@ -67,12 +67,8 @@ sdr::properties::BaseProperties* E3dExtrudeObj::CreateObjectSpecificProperties() TYPEINIT1(E3dExtrudeObj, E3dCompoundObject); -/************************************************************************* -|* -|* Konstruktor, erzeugt zwei Deckelflaechen-PolyPolygone und (PointCount-1) -|* Seitenflaechen-Rechtecke aus dem uebergebenen PolyPolygon -|* -\************************************************************************/ +// Constructor creates a two cover surface PolyPolygon and (point-count 1) side +// surfaces rectangles from the passed PolyPolygon E3dExtrudeObj::E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon& rPP, double fDepth) : E3dCompoundObject(rDefault), @@ -83,7 +79,7 @@ E3dExtrudeObj::E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DP aMirrorY.scale(1.0, -1.0); maExtrudePolygon.transform(aMirrorY); - // Defaults setzen + // Set Defaults SetDefaultAttributes(rDefault); // set extrude depth @@ -93,7 +89,7 @@ E3dExtrudeObj::E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DP E3dExtrudeObj::E3dExtrudeObj() : E3dCompoundObject() { - // Defaults setzen + // Set Defaults E3dDefaultAttributes aDefault; SetDefaultAttributes(aDefault); } @@ -106,17 +102,11 @@ void E3dExtrudeObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault) GetProperties().SetObjectItemDirect(Svx3DCloseFrontItem(rDefault.GetDefaultExtrudeCloseFront())); GetProperties().SetObjectItemDirect(Svx3DCloseBackItem(rDefault.GetDefaultExtrudeCloseBack())); - // Bei extrudes defaultmaessig StdTexture in X und Y + // For extrudes use StdTexture in X and Y by default GetProperties().SetObjectItemDirect(Svx3DTextureProjectionXItem(1)); GetProperties().SetObjectItemDirect(Svx3DTextureProjectionYItem(1)); } -/************************************************************************* -|* -|* Identifier zurueckgeben -|* -\************************************************************************/ - sal_uInt16 E3dExtrudeObj::GetObjIdentifier() const { return E3D_EXTRUDEOBJ_ID; @@ -127,11 +117,8 @@ E3dExtrudeObj* E3dExtrudeObj::Clone() const return CloneHelper< E3dExtrudeObj >(); } -/************************************************************************* -|* -|* Lokale Parameter setzen mit Geometrieneuerzeugung -|* -\************************************************************************/ + +// Set local parameters with geometry re-creating void E3dExtrudeObj::SetExtrudePolygon(const basegfx::B2DPolyPolygon &rNew) { @@ -142,11 +129,7 @@ void E3dExtrudeObj::SetExtrudePolygon(const basegfx::B2DPolyPolygon &rNew) } } -/************************************************************************* -|* -|* Get the name of the object (singular) -|* -\************************************************************************/ +// Get the name of the object (singular) void E3dExtrudeObj::TakeObjNameSingul(XubString& rName) const { @@ -162,23 +145,13 @@ void E3dExtrudeObj::TakeObjNameSingul(XubString& rName) const } } -/************************************************************************* -|* -|* Get the name of the object (plural) -|* -\************************************************************************/ +// Get the name of the object (plural) void E3dExtrudeObj::TakeObjNamePlural(XubString& rName) const { rName=ImpGetResStr(STR_ObjNamePluralExtrude3d); } -/************************************************************************* -|* -|* Aufbrechen -|* -\************************************************************************/ - sal_Bool E3dExtrudeObj::IsBreakObjPossible() { return sal_True; diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index b146ec1588cb..20d9c96739ab 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -53,7 +53,7 @@ #include <svx/dlgutil.hxx> #include <svx/dialmgr.hxx> -#include <svx/viewpt3d.hxx> // ProjectionType +#include <svx/viewpt3d.hxx> // Projection Type #include <svx/svxids.hrc> #include <svx/dialogs.hrc> @@ -113,7 +113,7 @@ Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aBtnAssign ( this, SVX_RES( BTN_ASSIGN ) ), aFLGeometrie ( this, SVX_RES( FL_GEOMETRIE ) ), - // Geometrie + // Geometry aFtPercentDiagonal ( this, SVX_RES( FT_PERCENT_DIAGONAL ) ), aMtrPercentDiagonal ( this, SVX_RES( MTR_PERCENT_DIAGONAL ) ), aFtBackscale ( this, SVX_RES( FT_BACKSCALE ) ), @@ -138,7 +138,7 @@ Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aBtnDoubleSided ( this, SVX_RES( BTN_DOUBLE_SIDED ) ), - // Darstellung + // Representation aFLRepresentation ( this, SVX_RES( FL_REPRESENTATION ) ), aFtShademode ( this, SVX_RES( FT_SHADEMODE ) ), aLbShademode ( this, SVX_RES( LB_SHADEMODE ) ), @@ -153,7 +153,7 @@ Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aFLCamera ( this, SVX_RES( FL_CAMERA ) ), aFLLight ( this, SVX_RES( FL_LIGHT ) ), - // Beleuchtung + // Lighting aBtnLight1 ( this, SVX_RES( BTN_LIGHT_1 ) ), aBtnLight2 ( this, SVX_RES( BTN_LIGHT_2 ) ), aBtnLight3 ( this, SVX_RES( BTN_LIGHT_3 ) ), @@ -174,7 +174,7 @@ Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aBtnLightColor ( this, SVX_RES( BTN_LIGHT_COLOR ) ), - // #99694# Keyboard shortcuts activate the next control, so the + // Keyboard shortcuts activate the next control, so the // order needed to be changed here aFTAmbientlight ( this, SVX_RES( FT_AMBIENTLIGHT ) ), // Text label aLbAmbientlight ( this, SVX_RES( LB_AMBIENTLIGHT ) ), // ListBox @@ -219,7 +219,7 @@ Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ), aCtlLightPreview ( this, SVX_RES( CTL_LIGHT_PREVIEW ) ), - // Unterer Bereich + // Lower Range aBtnConvertTo3D ( this, SVX_RES( BTN_CHANGE_TO_3D ) ), aBtnLatheObject ( this, SVX_RES( BTN_LATHE_OBJ ) ), aBtnPerspective ( this, SVX_RES( BTN_PERSPECTIVE ) ), @@ -253,7 +253,7 @@ Svx3DWin::Svx3DWin( SfxBindings* pInBindings, mpImpl->pPool = NULL; FreeResource(); - // Metrik einstellen + // Set Metric eFUnit = pInBindings->GetDispatcher()->GetModule()->GetFieldUnit(); aMtrDepth.SetUnit( eFUnit ); @@ -279,7 +279,7 @@ Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aBtnConvertTo3D.SetClickHdl( aLink ); aBtnLatheObject.SetClickHdl( aLink ); - // Geometrie + // Geometry aBtnNormalsObj.SetClickHdl( aLink ); aBtnNormalsFlat.SetClickHdl( aLink ); aBtnNormalsSphere.SetClickHdl( aLink ); @@ -287,10 +287,10 @@ Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aBtnNormalsInvert.SetClickHdl( aLink ); aBtnDoubleSided.SetClickHdl( aLink ); - // Darstellung + // Representation aBtnShadow3d.SetClickHdl( aLink ); - // Beleuchtung + // Lighting aBtnLight1.SetClickHdl( aLink ); aBtnLight2.SetClickHdl( aLink ); aBtnLight3.SetClickHdl( aLink ); @@ -305,7 +305,6 @@ Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aBtnTexColor.SetClickHdl( aLink ); aBtnTexReplace.SetClickHdl( aLink ); aBtnTexModulate.SetClickHdl( aLink ); - //aBtnTexBlend.SetClickHdl( aLink ); aBtnTexParallelX.SetClickHdl( aLink ); aBtnTexCircleX.SetClickHdl( aLink ); aBtnTexObjectX.SetClickHdl( aLink ); @@ -345,7 +344,7 @@ Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aNumVertical.SetModifyHdl( aLink ); aMtrSlant.SetModifyHdl( aLink ); - // Preview-Callback + // Preview callback aLink = LINK( this, Svx3DWin, ChangeLightCallbackHdl ); aCtlLightPreview.SetUserInteractiveChangeCallback(aLink); aLink = LINK( this, Svx3DWin, ChangeSelectionCallbackHdl ); @@ -356,7 +355,7 @@ Svx3DWin::Svx3DWin( SfxBindings* pInBindings, Construct(); - // Initiierung der Initialisierung der ColorLBs + // Initiation of the initialization of the ColorLBs SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings); if (pDispatcher != NULL) { @@ -478,14 +477,14 @@ void Svx3DWin::Construct() // ----------------------------------------------------------------------- void Svx3DWin::Reset() { - // Diverse Initialisierungen, default ist AllAttributes + // Various initializations, default is AllAttributes aLbShademode.SelectEntryPos( 0 ); aMtrMatSpecularIntensity.SetValue( 50 ); aBtnLight1.Check(); ClickUpdateHdl( NULL ); - // Nichts selektieren, um Fehler beim erstselektieren zu vermeiden + // Select nothing, to avoid errors when selecting the first aCtlLightPreview.GetSvx3DLightControl().SelectLight(0); } @@ -528,22 +527,21 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) // construct field values const SfxPoolItem* pItem; - // evtl. PoolUnit ermitteln + // Possible determine PoolUnit if( !mpImpl->pPool ) { mpImpl->pPool = rAttrs.GetPool(); - DBG_ASSERT( mpImpl->pPool, "Wo ist der Pool?" ); + DBG_ASSERT( mpImpl->pPool, "Where is the Pool? "); ePoolUnit = mpImpl->pPool->GetMetric( SID_ATTR_LINE_WIDTH ); } eFUnit = GetModuleFieldUnit( rAttrs ); -// Segmentanzahl aenderbar ? und andere Stati + // Segment Number Can be changed? and other states SfxItemState eState = rAttrs.GetItemState( SID_ATTR_3D_INTERN, sal_False, &pItem ); if( SFX_ITEM_SET == eState ) { sal_uInt32 nState = ( ( const SfxUInt32Item* )pItem )->GetValue(); - //sal_Bool bLathe = (sal_Bool) ( nState & 1 ); sal_Bool bExtrude = (sal_Bool) ( nState & 2 ); sal_Bool bSphere = (sal_Bool) ( nState & 4 ); sal_Bool bCube = (sal_Bool) ( nState & 8 ); @@ -552,7 +550,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) if( !bChart ) { - // Bei Cube-Objekten werden keine Segmente eingestellt + // For cube objects are no segments set aFtHorizontal.Enable( !bCube ); aNumHorizontal.Enable( !bCube ); aFtVertical.Enable( !bCube ); @@ -577,7 +575,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) aMtrDepth.SetEmptyFieldValue(); } - // Nur bei Lathe-Objekten gibt es einen Endwinkel + // There is a final angle only for Lathe objects. aFtEndAngle.Enable( !bExtrude && !bCube && !bSphere ); aMtrEndAngle.Enable( !bExtrude && !bCube && !bSphere ); if( bExtrude || bCube || bSphere ) @@ -585,7 +583,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } else { - // Geometrie + // Geometry aFtHorizontal.Enable( sal_False ); aNumHorizontal.Enable( sal_False ); aNumHorizontal.SetEmptyFieldValue(); @@ -600,7 +598,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) aMtrDepth.Enable( sal_False ); aMtrDepth.SetEmptyFieldValue(); - // Darstellung + // Representation aBtnShadow3d.Enable( sal_False ); aFtSlant.Enable( sal_False ); aMtrSlant.Enable( sal_False ); @@ -614,12 +612,12 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) aMtrFocalLength.SetEmptyFieldValue(); aFLCamera.Enable( sal_False ); - // Unterer Bereich + //Lower Range aBtnConvertTo3D.Enable( sal_False ); aBtnLatheObject.Enable( sal_False ); } } -// Bitmapfuellung ? -> Status + // Bitmap fill ? -> Status sal_Bool bBitmap(sal_False); eState = rAttrs.GetItemState(XATTR_FILLSTYLE); if(eState != SFX_ITEM_DONTCARE) @@ -648,8 +646,8 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) aFLTexture.Enable( bBitmap ); -// Geometrie - // Anzahl Segmente (horizontal) + // Geometry + // Number of segments (horizontal) if( aNumHorizontal.IsEnabled() ) { eState = rAttrs.GetItemState(SDRATTR_3DOBJ_HORZ_SEGS); @@ -659,8 +657,6 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) if(nValue != (sal_uInt32 )aNumHorizontal.GetValue()) { aNumHorizontal.SetValue( nValue ); - // evtl. am Ende... - // aCtlLightPreview.GetSvx3DLightControl().SetHorizontalSegments( (sal_uInt16)nValue ); bUpdate = sal_True; } else if( aNumHorizontal.IsEmptyFieldValue() ) @@ -676,7 +672,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Anzahl Segmente (vertikal) + //Number of segments (vertical) if( aNumVertical.IsEnabled() ) { eState = rAttrs.GetItemState(SDRATTR_3DOBJ_VERT_SEGS); @@ -686,8 +682,6 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) if( nValue != (sal_uInt32) aNumVertical.GetValue() ) { aNumVertical.SetValue( nValue ); - // evtl. am Ende... - //aCtlLightPreview.GetSvx3DLightControl().SetVerticalSegments( (sal_uInt16)nValue ); bUpdate = sal_True; } else if( aNumVertical.IsEmptyFieldValue() ) @@ -703,7 +697,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Tiefe + // Depth if( aMtrDepth.IsEnabled() ) { eState = rAttrs.GetItemState(SDRATTR_3DOBJ_DEPTH); @@ -732,7 +726,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Doppelwandig/-seitig + // Double walled / Double sided eState = rAttrs.GetItemState(SDRATTR_3DOBJ_DOUBLE_SIDED); if( eState != SFX_ITEM_DONTCARE ) { @@ -754,7 +748,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Kantenrundung + // Edge rounding if( aMtrPercentDiagonal.IsEnabled() ) { eState = rAttrs.GetItemState(SDRATTR_3DOBJ_PERCENT_DIAGONAL); @@ -779,7 +773,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Tiefenskalierung + // Depth scaling if( aMtrBackscale.IsEnabled() ) { eState = rAttrs.GetItemState(SDRATTR_3DOBJ_BACKSCALE); @@ -804,7 +798,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Endwinkel + // End angle if( aMtrEndAngle.IsEnabled() ) { eState = rAttrs.GetItemState(SDRATTR_3DOBJ_END_ANGLE); @@ -827,7 +821,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Normalentyp + // Normal type eState = rAttrs.GetItemState(SDRATTR_3DOBJ_NORMALS_KIND); if( eState != SFX_ITEM_DONTCARE ) { @@ -856,7 +850,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Normalen invertieren + // Normal inverted eState = rAttrs.GetItemState(SDRATTR_3DOBJ_NORMALS_INVERT); if( eState != SFX_ITEM_DONTCARE ) { @@ -878,7 +872,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // 2-seitige Beleuchtung + // 2-sided lighting eState = rAttrs.GetItemState(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING); if( eState != SFX_ITEM_DONTCARE ) { @@ -900,7 +894,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } -// Darstellung + // Representation // Shademode eState = rAttrs.GetItemState(SDRATTR_3DSCENE_SHADE_MODE); if( eState != SFX_ITEM_DONTCARE ) @@ -921,7 +915,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // 3D-Shatten + // 3D-Shadow eState = rAttrs.GetItemState(SDRATTR_3DOBJ_SHADOW_3D); if( eState != SFX_ITEM_DONTCARE ) { @@ -945,7 +939,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Neigung (Schatten) + // Inclination (Shadow) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_SHADOW_SLANT); if( eState != SFX_ITEM_DONTCARE ) { @@ -965,7 +959,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Distanz + // Distance eState = rAttrs.GetItemState(SDRATTR_3DSCENE_DISTANCE); if( eState != SFX_ITEM_DONTCARE ) { @@ -989,7 +983,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Brennweite + // Focal length eState = rAttrs.GetItemState(SDRATTR_3DSCENE_FOCAL_LENGTH); if( eState != SFX_ITEM_DONTCARE ) { @@ -1013,10 +1007,10 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } -// Beleuchtung +// Lighting Color aColor; basegfx::B3DVector aVector; - // Licht 1 (Farbe) + // Light 1 (Color) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_1); if( eState != SFX_ITEM_DONTCARE ) { @@ -1036,7 +1030,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 1 (an/aus) + // Light 1 (on/off) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_1); if( eState != SFX_ITEM_DONTCARE ) { @@ -1058,14 +1052,14 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 1 (Richtung) + // Light 1 (direction) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_1); if( eState != SFX_ITEM_DONTCARE ) { bUpdate = sal_True; } - // Licht 2 (Farbe) + //Light 2 (color) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_2); if( eState != SFX_ITEM_DONTCARE ) { @@ -1085,7 +1079,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 2 (an/aus) + // Light 2 (on/off) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_2); if( eState != SFX_ITEM_DONTCARE ) { @@ -1107,14 +1101,14 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 2 (Richtung) + //Light 2 (Direction) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_2); if( eState != SFX_ITEM_DONTCARE ) { bUpdate = sal_True; } - // Licht 3 (Farbe) + //Light 3 (color) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_3); if( eState != SFX_ITEM_DONTCARE ) { @@ -1134,7 +1128,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 3 (an/aus) + // Ligh 3 (on/off) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_3); if( eState != SFX_ITEM_DONTCARE ) { @@ -1156,14 +1150,14 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 3 (Richtung) + // Light 3 (Direction) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_3); if( eState != SFX_ITEM_DONTCARE ) { bUpdate = sal_True; } - // Licht 4 (Farbe) + // Light 4 (Color) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_4); if( eState != SFX_ITEM_DONTCARE ) { @@ -1183,7 +1177,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 4 (an/aus) + // Light 4 (on/off) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_4); if( eState != SFX_ITEM_DONTCARE ) { @@ -1205,14 +1199,14 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 4 (Richtung) + // Light 4 (direction) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_4); if( eState != SFX_ITEM_DONTCARE ) { bUpdate = sal_True; } - // Licht 5 (Farbe) + // Light 5 (color) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_5); if( eState != SFX_ITEM_DONTCARE ) { @@ -1232,7 +1226,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 5 (an/aus) + // Light 5 (on/off) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_5); if( eState != SFX_ITEM_DONTCARE ) { @@ -1254,14 +1248,14 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 5 (Richtung) + // Light 5 (direction) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_5); if( eState != SFX_ITEM_DONTCARE ) { bUpdate = sal_True; } - // Licht 6 (Farbe) + // Light 6 (color) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_6); if( eState != SFX_ITEM_DONTCARE ) { @@ -1281,7 +1275,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 6 (an/aus) + // Light 6 (on/off) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_6); if( eState != SFX_ITEM_DONTCARE ) { @@ -1303,14 +1297,14 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 6 (Richtung) + // Light 6 (direction) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_6); if( eState != SFX_ITEM_DONTCARE ) { bUpdate = sal_True; } - // Licht 7 (Farbe) + // Light 7 (color) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_7); if( eState != SFX_ITEM_DONTCARE ) { @@ -1330,7 +1324,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 7 (an/aus) + // Light 7 (on/off) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_7); if( eState != SFX_ITEM_DONTCARE ) { @@ -1352,14 +1346,14 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 7 (Richtung) + // Light 7 (direction) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_7); if( eState != SFX_ITEM_DONTCARE ) { bUpdate = sal_True; } - // Licht 8 (Farbe) + // Light 8 (color) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_8); if( eState != SFX_ITEM_DONTCARE ) { @@ -1379,7 +1373,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 8 (an/aus) + // Light 8 (on/off) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_8); if( eState != SFX_ITEM_DONTCARE ) { @@ -1401,14 +1395,14 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) bUpdate = sal_True; } } - // Licht 8 (Richtung) + // Light 8 (direction) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_8); if( eState != SFX_ITEM_DONTCARE ) { bUpdate = sal_True; } - // Umgebungslicht + // Ambient light eState = rAttrs.GetItemState(SDRATTR_3DSCENE_AMBIENTCOLOR); if( eState != SFX_ITEM_DONTCARE ) { @@ -1458,7 +1452,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Modus + // Mode eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_MODE); if( eState != SFX_ITEM_DONTCARE ) { @@ -1469,7 +1463,6 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) { aBtnTexReplace.Check( nValue == 1 ); aBtnTexModulate.Check( nValue == 2 ); - //aBtnTexBlend.Check( nValue == 2 ); bUpdate = sal_True; } } @@ -1480,12 +1473,11 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) { aBtnTexReplace.Check( sal_False ); aBtnTexModulate.Check( sal_False ); - //aBtnTexBlend.Check( sal_False ); bUpdate = sal_True; } } - // Projektion X + // Projection X eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_PROJ_X); if( eState != SFX_ITEM_DONTCARE ) { @@ -1514,7 +1506,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Projektion Y + // Projection Y eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_PROJ_Y); if( eState != SFX_ITEM_DONTCARE ) { @@ -1567,10 +1559,10 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } - // Material Favoriten + // Material Favorites aLbMatFavorites.SelectEntryPos( 0 ); - // Objektfarbe + // Object color eState = rAttrs.GetItemState(XATTR_FILLCOLOR); if( eState != SFX_ITEM_DONTCARE ) { @@ -1591,7 +1583,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Slebstleuchtfarbe + // Self-luminous color eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_EMISSION); if( eState != SFX_ITEM_DONTCARE ) { @@ -1612,7 +1604,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Glanzpunkt + // Specular eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_SPECULAR); if( eState != SFX_ITEM_DONTCARE ) { @@ -1633,7 +1625,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } } - // Glanzpunkt Intensitaet + // Specular Intensity eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY); if( eState != SFX_ITEM_DONTCARE ) { @@ -1654,8 +1646,8 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) } -// Sonstige - // Perspektive +// Other + // Perspective eState = rAttrs.GetItemState(SDRATTR_3DSCENE_PERSPECTIVE); if( eState != SFX_ITEM_DONTCARE ) { @@ -1680,16 +1672,14 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) if( !bUpdate && !bOnly3DChanged ) { - // Eventuell sind aber die 2D-Attribute unterschiedlich. Vergleiche - // diese und entscheide - + // however the 2D attributes may be different. Compare these and decide bUpdate = sal_True; } if( bUpdate || bOnly3DChanged ) { - // Preview updaten + // Update preview SfxItemSet aSet(rAttrs); // set LineStyle hard to XLINE_NONE when it's not set so that @@ -1757,8 +1747,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) } } -// Sonstige, muss vorne stehen da auf allen Seiten - // Perspektive +//Others must stand as the front on all sides + // Perspective if( aBtnPerspective.GetState() != STATE_DONTKNOW ) { sal_uInt16 nValue; @@ -1771,19 +1761,19 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_PERSPECTIVE); -// Geometrie - // evtl. PoolUnit ermitteln (Falls dies in Update() nicht passiert ist) +// Geometry + // Possible determine PoolUnit (in this case this haas not happend in Update() ) if( !mpImpl->pPool ) { - OSL_FAIL( "Kein Pool in GetAttr()! Evtl. inkompatibel zu drviewsi.cxx ?" ); + OSL_FAIL( "No Pool in GetAttr()! May be incompatible to drviewsi.cxx ?" ); mpImpl->pPool = rAttrs.GetPool(); - DBG_ASSERT( mpImpl->pPool, "Wo ist der Pool?" ); + DBG_ASSERT( mpImpl->pPool, "Where is the Pool?" ); ePoolUnit = mpImpl->pPool->GetMetric( SID_ATTR_LINE_WIDTH ); eFUnit = GetModuleFieldUnit( rAttrs ); } - // Anzahl Segmente (horizontal) + // Number of segments (horizontal) if( !aNumHorizontal.IsEmptyFieldValue() ) { sal_uInt32 nValue = static_cast<sal_uInt32>(aNumHorizontal.GetValue()); @@ -1792,7 +1782,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_HORZ_SEGS); - // Anzahl Segmente (vertikal) + // Number of segments (vertical) if( !aNumVertical.IsEmptyFieldValue() ) { sal_uInt32 nValue = static_cast<sal_uInt32>(aNumVertical.GetValue()); @@ -1801,7 +1791,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_VERT_SEGS); - // Tiefe + // Depth if( !aMtrDepth.IsEmptyFieldValue() ) { sal_uInt32 nValue = GetCoreValue( aMtrDepth, ePoolUnit ); @@ -1810,7 +1800,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_DEPTH); - // Doppelseitig + // Double-sided TriState eState = aBtnDoubleSided.GetState(); if( eState != STATE_DONTKNOW ) { @@ -1820,7 +1810,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_DOUBLE_SIDED); - // Kantenrundung + // Edge rounding if( !aMtrPercentDiagonal.IsEmptyFieldValue() ) { sal_uInt16 nValue = (sal_uInt16) aMtrPercentDiagonal.GetValue(); @@ -1829,7 +1819,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_PERCENT_DIAGONAL); - // Tiefenskalierung + // Depth scale if( !aMtrBackscale.IsEmptyFieldValue() ) { sal_uInt16 nValue = (sal_uInt16)aMtrBackscale.GetValue(); @@ -1838,7 +1828,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_BACKSCALE); - // Endwinkel + // End angle if( !aMtrEndAngle.IsEmptyFieldValue() ) { sal_uInt16 nValue = (sal_uInt16)aMtrEndAngle.GetValue(); @@ -1847,7 +1837,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_END_ANGLE); - // Normalentyp + // Normal type sal_uInt16 nValue = 99; if( aBtnNormalsObj.IsChecked() ) nValue = 0; @@ -1861,7 +1851,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_NORMALS_KIND); - // Normalen invertieren + // Normal inverted eState = aBtnNormalsInvert.GetState(); if( eState != STATE_DONTKNOW ) { @@ -1871,7 +1861,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_NORMALS_INVERT); - // 2-seitige Beleuchtung + // 2-sided lighting eState = aBtnTwoSidedLighting.GetState(); if( eState != STATE_DONTKNOW ) { @@ -1881,8 +1871,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING); -// Darstellung - // Shademode +// Representation + // Shade mode if( aLbShademode.GetSelectEntryCount() ) { nValue = aLbShademode.GetSelectEntryPos(); @@ -1891,7 +1881,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_SHADE_MODE); - // 3D-Shatten + // 3D-Shadow eState = aBtnShadow3d.GetState(); if( eState != STATE_DONTKNOW ) { @@ -1905,7 +1895,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) rAttrs.InvalidateItem(SDRATTR_SHADOW); } - // Neigung (Schatten) + // Slant (Shadow) if( !aMtrSlant.IsEmptyFieldValue() ) { sal_uInt16 nValue2 = (sal_uInt16) aMtrSlant.GetValue(); @@ -1914,7 +1904,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_SHADOW_SLANT); - // Distanz + // Distance if( !aMtrDistance.IsEmptyFieldValue() ) { sal_uInt32 nValue2 = GetCoreValue( aMtrDistance, ePoolUnit ); @@ -1923,7 +1913,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_DISTANCE); - // Brennweite + // Focal length if( !aMtrFocalLength.IsEmptyFieldValue() ) { sal_uInt32 nValue2 = GetCoreValue( aMtrFocalLength, ePoolUnit ); @@ -1932,13 +1922,13 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_FOCAL_LENGTH); -// Beleuchtung +// Lighting Image aImg; basegfx::B3DVector aVector; Color aColor; const SfxItemSet aLightItemSet(aCtlLightPreview.GetSvx3DLightControl().Get3DAttributes()); - // Licht 1 Farbe + // Light 1 color if( aLbLight1.GetSelectEntryCount() ) { aColor = aLbLight1.GetSelectEntryColor(); @@ -1946,14 +1936,14 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) } else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_1); - // Licht 1 (an/aus) + // Light 1 (on/off) eState = aBtnLight1.GetState(); if( eState != STATE_DONTKNOW ) { sal_Bool bValue = GetUILightState( aBtnLight1 ); rAttrs.Put(Svx3DLightOnOff1Item(bValue)); - // Licht 1 (Richtung) + // Light 1 (direction) if( bValue ) { rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)); @@ -1963,7 +1953,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_1); - // Licht 2 Farbe + // Light 2 color if( aLbLight2.GetSelectEntryCount() ) { aColor = aLbLight2.GetSelectEntryColor(); @@ -1971,14 +1961,14 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) } else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_2); - // Licht 2 (an/aus) + // Light 2 (on/off) eState = aBtnLight2.GetState(); if( eState != STATE_DONTKNOW ) { sal_Bool bValue = GetUILightState( aBtnLight2 ); rAttrs.Put(Svx3DLightOnOff2Item(bValue)); - // Licht 2 (Richtung) + // Light 2 (direction) if( bValue ) { rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)); @@ -1987,7 +1977,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_2); - // Licht 3 Farbe + // Light 3 color if( aLbLight3.GetSelectEntryCount() ) { aColor = aLbLight3.GetSelectEntryColor(); @@ -1995,14 +1985,14 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) } else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_3); - // Licht 3 (an/aus) + // Light 3 (on/off) eState = aBtnLight3.GetState(); if( eState != STATE_DONTKNOW ) { sal_Bool bValue = GetUILightState( aBtnLight3 ); rAttrs.Put(Svx3DLightOnOff3Item(bValue)); - // Licht 3 (Richtung) + // Light 3 (direction) if( bValue ) { rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)); @@ -2011,7 +2001,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_3); - // Licht 4 Farbe + // Light 4 color if( aLbLight4.GetSelectEntryCount() ) { aColor = aLbLight4.GetSelectEntryColor(); @@ -2019,14 +2009,14 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) } else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_4); - // Licht 4 (an/aus) + // Light 4 (on/off) eState = aBtnLight4.GetState(); if( eState != STATE_DONTKNOW ) { sal_Bool bValue = GetUILightState( aBtnLight4 ); rAttrs.Put(Svx3DLightOnOff4Item(bValue)); - // Licht 4 (Richtung) + // Light 4 (direction) if( bValue ) { rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)); @@ -2035,7 +2025,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_4); - // Licht 5 Farbe + // Light 5 color if( aLbLight5.GetSelectEntryCount() ) { aColor = aLbLight5.GetSelectEntryColor(); @@ -2043,14 +2033,14 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) } else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_5); - // Licht 5 (an/aus) + // Light 5 (on/off) eState = aBtnLight5.GetState(); if( eState != STATE_DONTKNOW ) { sal_Bool bValue = GetUILightState( aBtnLight5 ); rAttrs.Put(Svx3DLightOnOff5Item(bValue)); - // Licht 5 (Richtung) + // Light 5 (direction) if( bValue ) { rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)); @@ -2059,7 +2049,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_5); - // Licht 6 Farbe + // Light 6 color if( aLbLight6.GetSelectEntryCount() ) { aColor = aLbLight6.GetSelectEntryColor(); @@ -2067,14 +2057,14 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) } else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_6); - // Licht 6 (an/aus) + // Light 6 (on/off) eState = aBtnLight6.GetState(); if( eState != STATE_DONTKNOW ) { sal_Bool bValue = GetUILightState( aBtnLight6 ); rAttrs.Put(Svx3DLightOnOff6Item(bValue)); - // Licht 6 (Richtung) + // Light 6 (direction) if( bValue ) { rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)); @@ -2083,7 +2073,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_6); - // Licht 7 Farbe + // Light 7 color if( aLbLight7.GetSelectEntryCount() ) { aColor = aLbLight7.GetSelectEntryColor(); @@ -2091,14 +2081,14 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) } else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_7); - // Licht 7 (an/aus) + // Light 7 (on/off) eState = aBtnLight7.GetState(); if( eState != STATE_DONTKNOW ) { sal_Bool bValue = GetUILightState( aBtnLight7 ); rAttrs.Put(Svx3DLightOnOff7Item(bValue)); - // Licht 7 (Richtung) + // Light 7 (direction) if( bValue ) { rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)); @@ -2107,7 +2097,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_7); - // Licht 8 Farbe + // Light 8 color if( aLbLight8.GetSelectEntryCount() ) { aColor = aLbLight8.GetSelectEntryColor(); @@ -2115,14 +2105,14 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) } else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_8); - // Licht 8 (an/aus) + // Light 8 (on/off) eState = aBtnLight8.GetState(); if( eState != STATE_DONTKNOW ) { sal_Bool bValue = GetUILightState( aBtnLight8 ); rAttrs.Put(Svx3DLightOnOff8Item(bValue)); - // Licht 8 (Richtung) + // Light 8 (direction) if( bValue ) { rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)); @@ -2131,7 +2121,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_8); - // Umgebungslicht + // Ambient light if( aLbAmbientlight.GetSelectEntryCount() ) { aColor = aLbAmbientlight.GetSelectEntryColor(); @@ -2154,21 +2144,19 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_KIND); - // Modus + // Mode nValue = 99; if( aBtnTexReplace.IsChecked() ) nValue = 1; else if( aBtnTexModulate.IsChecked() ) nValue = 2; - //else if( aBtnTexBlend.IsChecked() ) - // nValue = 2; if( nValue == 1 || nValue == 2 ) rAttrs.Put(Svx3DTextureModeItem(nValue)); else rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_MODE); - // Projektion X + // X projection nValue = 99; if( aBtnTexObjectX.IsChecked() ) nValue = 0; @@ -2182,7 +2170,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_PROJ_X); - // Projektion Y + // Y projection nValue = 99; if( aBtnTexObjectY.IsChecked() ) nValue = 0; @@ -2209,7 +2197,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) // Material - // Objektfarbe + // Object color if( aLbMatColor.GetSelectEntryCount() ) { aColor = aLbMatColor.GetSelectEntryColor(); @@ -2220,7 +2208,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) rAttrs.InvalidateItem( XATTR_FILLCOLOR ); } - // Slebstleuchtfarbe + // luminous color if( aLbMatEmission.GetSelectEntryCount() ) { aColor = aLbMatEmission.GetSelectEntryColor(); @@ -2229,7 +2217,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_EMISSION); - // Glanzpunkt + // Specular if( aLbMatSpecular.GetSelectEntryCount() ) { aColor = aLbMatSpecular.GetSelectEntryColor(); @@ -2238,7 +2226,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_SPECULAR); - // Glanzpunkt Intensitaet + // Specular intensity if( !aMtrMatSpecularIntensity.IsEmptyFieldValue() ) { sal_uInt16 nValue2 = (sal_uInt16) aMtrMatSpecularIntensity.GetValue(); @@ -2254,7 +2242,7 @@ void Svx3DWin::Resize() if ( !IsFloatingMode() || !GetFloatingWindow()->IsRollUp() ) { - Size aWinSize( GetOutputSizePixel() ); // vorher rSize im Resizing() + Size aWinSize( GetOutputSizePixel() ); // why rSize in Resizing()? if( aWinSize.Height() >= GetMinOutputSizePixel().Height() && aWinSize.Width() >= GetMinOutputSizePixel().Width() ) @@ -2287,11 +2275,11 @@ void Svx3DWin::Resize() aFLTexture.Hide(); aFLMaterial.Hide(); - // Verschieben / Resizen + // Moving / resizing aBtnUpdate.SetPosPixel( aBtnUpdate.GetPosPixel() + aXPt ); aBtnAssign.SetPosPixel( aBtnAssign.GetPosPixel() + aXPt ); - // Preview-Controls + // Preview controls aObjSize = aCtlPreview.GetOutputSizePixel(); aObjSize.Width() += aDiffSize.Width(); aObjSize.Height() += aDiffSize.Height(); @@ -2310,7 +2298,7 @@ void Svx3DWin::Resize() aFLTexture.SetOutputSizePixel( aObjSize ); aFLMaterial.SetOutputSizePixel( aObjSize ); - // Y-Position der unteren Buttons + // Y-position of the lower buttons aBtnConvertTo3D.SetPosPixel( aBtnConvertTo3D.GetPosPixel() + aYPt ); aBtnLatheObject.SetPosPixel( aBtnLatheObject.GetPosPixel() + aYPt ); aBtnPerspective.SetPosPixel( aBtnPerspective.GetPosPixel() + aYPt ); @@ -2359,7 +2347,7 @@ IMPL_LINK( Svx3DWin, ClickUpdateHdl, void *, EMPTYARG ) } else { - // Controls koennen u.U. disabled sein + // Controls can be disabled during certain circumstances } return( 0L ); @@ -2386,7 +2374,7 @@ IMPL_LINK( Svx3DWin, ClickViewTypeHdl, void *, pBtn ) if( pBtn ) { - // Da das permanente Updaten der Preview zu teuer waere + // Since the permanent updating of the preview would be too expensive sal_Bool bUpdatePreview = aBtnLight.IsChecked(); aBtnGeo.Check( &aBtnGeo == pBtn ); @@ -2406,7 +2394,7 @@ IMPL_LINK( Svx3DWin, ClickViewTypeHdl, void *, pBtn ) if( aBtnMaterial.IsChecked() ) eViewType = VIEWTYPE_MATERIAL; - // Geometrie + // Geometry if( eViewType == VIEWTYPE_GEO ) { aFtHorizontal.Show(); @@ -2458,7 +2446,7 @@ IMPL_LINK( Svx3DWin, ClickViewTypeHdl, void *, pBtn ) aBtnDoubleSided.Hide(); } - // Darstellung + // Representation if( eViewType == VIEWTYPE_REPRESENTATION ) { aFtShademode.Show(); @@ -2490,7 +2478,7 @@ IMPL_LINK( Svx3DWin, ClickViewTypeHdl, void *, pBtn ) aFLRepresentation.Hide(); } - // Beleuchtung + // Lighting if( eViewType == VIEWTYPE_LIGHT ) { aBtnLight1.Show(); @@ -2501,17 +2489,12 @@ IMPL_LINK( Svx3DWin, ClickViewTypeHdl, void *, pBtn ) aBtnLight6.Show(); aBtnLight7.Show(); aBtnLight8.Show(); - //aLbLight1.Show(); aBtnLightColor.Show(); aFTLightsource.Show(); aLbAmbientlight.Show(); aBtnAmbientColor.Show(); aFTAmbientlight.Show(); aFLLight.Show(); - //aFtLightX.Show(); - //aFtLightY.Show(); - //aFtLightZ.Show(); - //aGrpLightInfo.Show(); ColorLB* pLb = GetLbByButton(); if( pLb ) @@ -2561,7 +2544,6 @@ IMPL_LINK( Svx3DWin, ClickViewTypeHdl, void *, pBtn ) aFtTexMode.Show(); aBtnTexReplace.Show(); aBtnTexModulate.Show(); - //aBtnTexBlend.Show(); aFtTexProjectionX.Show(); aBtnTexParallelX.Show(); aBtnTexCircleX.Show(); @@ -2665,7 +2647,7 @@ IMPL_LINK( Svx3DWin, ClickHdl, PushButton *, pBtn ) { nSId = SID_CONVERT_TO_3D_LATHE_FAST; } - // Geometrie + // Geometry else if( pBtn == &aBtnNormalsObj || pBtn == &aBtnNormalsFlat || pBtn == &aBtnNormalsSphere ) @@ -2684,7 +2666,7 @@ IMPL_LINK( Svx3DWin, ClickHdl, PushButton *, pBtn ) pBtn == &aBtnLight7 || pBtn == &aBtnLight8 ) { - // Beleuchtung + // Lighting ColorLB* pLb = GetLbByButton( pBtn ); pLb->Show(); @@ -2753,12 +2735,10 @@ IMPL_LINK( Svx3DWin, ClickHdl, PushButton *, pBtn ) bUpdatePreview = sal_True; } else if( pBtn == &aBtnTexReplace || - pBtn == &aBtnTexModulate )// || - //pBtn == &aBtnTexBlend ) + pBtn == &aBtnTexModulate ) { aBtnTexReplace.Check( pBtn == &aBtnTexReplace ); aBtnTexModulate.Check( pBtn == &aBtnTexModulate ); - //aBtnTexBlend.Check( pBtn == &aBtnTexBlend ); bUpdatePreview = sal_True; } else if( pBtn == &aBtnTexParallelX || @@ -2786,7 +2766,7 @@ IMPL_LINK( Svx3DWin, ClickHdl, PushButton *, pBtn ) aMtrSlant.Enable( pBtn->IsChecked() ); bUpdatePreview = sal_True; } - // Sonstige (keine Gruppen) + // Other (no groups) else if( pBtn != NULL ) { pBtn->Check( !pBtn->IsChecked() ); @@ -2876,7 +2856,7 @@ IMPL_LINK( Svx3DWin, SelectHdl, void *, p ) } break; - case 3: // Chrom + case 3: // Chrome { aColObj = Color(36,117,153); aColEmis = Color(18,30,51); @@ -2885,7 +2865,7 @@ IMPL_LINK( Svx3DWin, SelectHdl, void *, p ) } break; - case 4: // Plastik + case 4: // Plastic { aColObj = Color(255,48,57); aColEmis = Color(35,0,0); @@ -2894,7 +2874,7 @@ IMPL_LINK( Svx3DWin, SelectHdl, void *, p ) } break; - case 5: // Holz + case 5: // Wood { aColObj = Color(153,71,1); aColEmis = Color(21,22,0); @@ -2917,7 +2897,7 @@ IMPL_LINK( Svx3DWin, SelectHdl, void *, p ) aLbMatFavorites.SelectEntryPos( 0 ); bUpdatePreview = sal_True; } - // Beleuchtung + // Lighting else if( p == &aLbAmbientlight ) { bUpdatePreview = sal_True; @@ -3010,12 +2990,7 @@ IMPL_LINK( Svx3DWin, ClickLightHdl, PushButton*, pBtn ) // ----------------------------------------------------------------------- IMPL_LINK( Svx3DWin, DoubleClickHdl, void*, EMPTYARG ) { - //sal_uInt16 nItemId = aCtlFavorites.GetSelectItemId(); - - //SfxItemSet* pSet = (SfxItemSet*) pFavorSetList->GetObject( nItemId - 1 ); - //Update( *pSet ); - - // und zuweisen + // and assign ClickAssignHdl( NULL ); return( 0L ); @@ -3053,7 +3028,7 @@ IMPL_LINK( Svx3DWin, ChangeSelectionCallbackHdl, void*, EMPTYARG ) ClickHdl( pBtn ); else { - // Zustand: Keine Lampe selektiert + // Status: No lamp selected if( aBtnLight1.IsChecked() ) { aBtnLight1.Check( sal_False ); @@ -3101,8 +3076,8 @@ IMPL_LINK( Svx3DWin, ChangeSelectionCallbackHdl, void*, EMPTYARG ) } // ----------------------------------------------------------------------- -// Methode um sicherzustellen, dass die LB auch mit einer Farbe gesetzt ist -// Liefert sal_True zurueck, falls Farbe hinzugefuegt wurde +// Method to ensure that the LB is also associated with a color +// returns true if color was added // ----------------------------------------------------------------------- sal_Bool Svx3DWin::LBSelectColor( ColorLB* pLb, const Color& rColor ) { @@ -3137,7 +3112,7 @@ void Svx3DWin::UpdatePreview() if(bOnly3DChanged) { - // slot executen + // Execute slot SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings); if (pDispatcher != NULL) { @@ -3145,21 +3120,21 @@ void Svx3DWin::UpdatePreview() pDispatcher->Execute( SID_3D_STATE, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L ); } - // Flag zuruecksetzen + // Reset Flag bOnly3DChanged = sal_False; } - // ItemSet besorgen + // Get Itemset SfxItemSet aSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END); - // Attribute holen und im Preview setzen + // Get Attributes and set the preview GetAttr( aSet ); aCtlPreview.Set3DAttributes( aSet ); aCtlLightPreview.GetSvx3DLightControl().Set3DAttributes( aSet ); } ////////////////////////////////////////////////////////////////////////////// -// document is to be reloaded, destroy remembered ItemSet (#83951#) +// document is to be reloaded, destroy remembered ItemSet void Svx3DWin::DocumentReload() { if(mpRemember2DAttributes) @@ -3183,7 +3158,7 @@ void Svx3DWin::InitColorLB( const SdrModel* pDoc ) aLbMatEmission.CopyEntries( aLbLight1 ); aLbMatSpecular.CopyEntries( aLbLight1 ); - // Erstmal... + // First... Color aColWhite( COL_WHITE ); Color aColBlack( COL_BLACK ); aLbLight1.SelectEntry( aColWhite ); @@ -3292,11 +3267,8 @@ ColorLB* Svx3DWin::GetLbByButton( const PushButton* pBtn ) return( pLb ); }; -/************************************************************************* -|* -|* Ableitung vom SfxChildWindow als "Behaelter" fuer Effekte -|* -\************************************************************************/ +// Derivation from SfxChildWindow as "containers" for effects + Svx3DChildWindow::Svx3DChildWindow( Window* _pParent, sal_uInt16 nId, SfxBindings* pBindings, @@ -3311,11 +3283,6 @@ Svx3DChildWindow::Svx3DChildWindow( Window* _pParent, pWin->Initialize( pInfo ); } -/************************************************************************* -|* -|* ControllerItem fuer 3DStatus -|* -\************************************************************************/ Svx3DCtrlItem::Svx3DCtrlItem( sal_uInt16 _nId, Svx3DWin* pWin, SfxBindings* _pBindings) : @@ -3330,11 +3297,7 @@ void Svx3DCtrlItem::StateChanged( sal_uInt16 /*nSId*/, { } -/************************************************************************* -|* -|* ControllerItem fuer Status Slot SID_CONVERT_TO_3D -|* -\************************************************************************/ +// ControllerItem for Status Slot SID_CONVERT_TO_3D SvxConvertTo3DItem::SvxConvertTo3DItem(sal_uInt16 _nId, SfxBindings* _pBindings) : SfxControllerItem(_nId, *_pBindings), diff --git a/svx/source/engine3d/float3d.src b/svx/source/engine3d/float3d.src index e03ab866fe08..3c90a26f838c 100644 --- a/svx/source/engine3d/float3d.src +++ b/svx/source/engine3d/float3d.src @@ -173,7 +173,7 @@ DockingWindow RID_SVXFLOAT_3D }; QuickHelpText [ en-US ] = "Assign" ; }; - // Unterer Teil + // Lower part ImageButton BTN_CHANGE_TO_3D { HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_CHANGE_TO_3D"; @@ -333,7 +333,7 @@ DockingWindow RID_SVXFLOAT_3D Size = FIXED_LINE_SIZE; Text [ en-US ] = "Segments" ; }; - // Geometrie + // Geometry FixedText FT_HORIZONTAL { Pos = MAP_APPFONT ( FT_INDENT , SEGMENTS_START_Y+13 ) ; @@ -461,7 +461,7 @@ DockingWindow RID_SVXFLOAT_3D QuickHelpText [ en-US ] = "Double-Sided" ; }; - // Darstellung + // Representation FixedText FT_SHADEMODE { Pos = MAP_APPFONT ( FT_INDENT , FIRST_FT_START_Y ) ; @@ -588,7 +588,7 @@ DockingWindow RID_SVXFLOAT_3D Size = FIXED_LINE_SIZE; Text [ en-US ] = "Shading" ; }; - // Beleuchtung + // Lighting FixedText FT_LIGHTSOURCE { Pos = MAP_APPFONT ( FT_INDENT , FIRST_FT_START_Y ) ; @@ -819,7 +819,7 @@ DockingWindow RID_SVXFLOAT_3D Size = FIXED_LINE_SIZE ; Text [ en-US ] = "Illumination" ; }; - // Texturen + // Textures FixedText FT_TEX_KIND { Pos = MAP_APPFONT ( FT_INDENT , FIRST_FT_START_Y ) ; diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx index 323aeff0b58b..3af96e0a2cec 100644 --- a/svx/source/engine3d/lathe3d.cxx +++ b/svx/source/engine3d/lathe3d.cxx @@ -47,7 +47,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> ////////////////////////////////////////////////////////////////////////////// -// #110094# DrawContact section +// DrawContact section sdr::contact::ViewContact* E3dLatheObj::CreateObjectSpecificViewContact() { @@ -65,12 +65,7 @@ sdr::properties::BaseProperties* E3dLatheObj::CreateObjectSpecificProperties() TYPEINIT1(E3dLatheObj, E3dCompoundObject); -/************************************************************************* -|* -|* Konstruktor aus 3D-Polygon, Scale gibt den Umrechnungsfaktor fuer -|* die Koordinaten an -|* -\************************************************************************/ +// Constructor from 3D polygon, scale is the conversion factor for the coordinates E3dLatheObj::E3dLatheObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon rPoly2D) : E3dCompoundObject(rDefault), @@ -81,11 +76,11 @@ E3dLatheObj::E3dLatheObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyP aMirrorY.scale(1.0, -1.0); maPolyPoly2D.transform(aMirrorY); - // Defaults setzen + // Set Defaults SetDefaultAttributes(rDefault); - // Ueberfluessige Punkte entfernen, insbesondere doppelte - // Start- und Endpunkte verhindern + // Superfluous items removed, in particular to prevent duplicate + // start and end points maPolyPoly2D.removeDoublePoints(); if(maPolyPoly2D.count()) @@ -102,16 +97,10 @@ E3dLatheObj::E3dLatheObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyP } } -/************************************************************************* -|* -|* Leer-Konstruktor -|* -\************************************************************************/ - E3dLatheObj::E3dLatheObj() : E3dCompoundObject() { - // Defaults setzen + // Set Defaults E3dDefaultAttributes aDefault; SetDefaultAttributes(aDefault); } @@ -125,12 +114,6 @@ void E3dLatheObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault) GetProperties().SetObjectItemDirect(Svx3DCloseBackItem(rDefault.GetDefaultLatheCloseBack())); } -/************************************************************************* -|* -|* Identifier zurueckgeben -|* -\************************************************************************/ - sal_uInt16 E3dLatheObj::GetObjIdentifier() const { return E3D_LATHEOBJ_ID; @@ -141,23 +124,13 @@ E3dLatheObj* E3dLatheObj::Clone() const return CloneHelper< E3dLatheObj >(); } -/************************************************************************* -|* -|* Wandle das Objekt in ein Gruppenobjekt bestehend aus n Polygonen -|* -\************************************************************************/ +// Convert the object to group object consisting of n polygons SdrObject *E3dLatheObj::DoConvertToPolyObj(sal_Bool /*bBezier*/) const { return NULL; } -/************************************************************************* -|* -|* Neue Segmentierung (Beschreibung siehe Header-File) -|* -\************************************************************************/ - void E3dLatheObj::ReSegment(sal_uInt32 nHSegs, sal_uInt32 nVSegs) { if ((nHSegs != GetHorizontalSegments() || nVSegs != GetVerticalSegments()) && @@ -170,11 +143,7 @@ void E3dLatheObj::ReSegment(sal_uInt32 nHSegs, sal_uInt32 nVSegs) } } -/************************************************************************* -|* -|* Lokale Parameter setzen mit Geometrieneuerzeugung -|* -\************************************************************************/ +// Set Local parameters set to re-create geometry void E3dLatheObj::SetPolyPoly2D(const basegfx::B2DPolyPolygon& rNew) { @@ -200,11 +169,7 @@ void E3dLatheObj::SetPolyPoly2D(const basegfx::B2DPolyPolygon& rNew) } } -/************************************************************************* -|* -|* Get the name of the object (singular) -|* -\************************************************************************/ +// Get the name of the object (singular) void E3dLatheObj::TakeObjNameSingul(XubString& rName) const { @@ -220,23 +185,13 @@ void E3dLatheObj::TakeObjNameSingul(XubString& rName) const } } -/************************************************************************* -|* -|* Get the name of the object (plural) -|* -\************************************************************************/ +// Get the name of the object (plural) void E3dLatheObj::TakeObjNamePlural(XubString& rName) const { rName=ImpGetResStr(STR_ObjNamePluralLathe3d); } -/************************************************************************* -|* -|* Aufbrechen -|* -\************************************************************************/ - sal_Bool E3dLatheObj::IsBreakObjPossible() { return sal_True; @@ -251,10 +206,10 @@ SdrAttrObj* E3dLatheObj::GetBreakObj() if(pPathObj) { - // Attribute setzen + // Set Attribute SfxItemSet aSet(GetObjectItemSet()); - // Linien aktivieren, um Objekt garantiert sichtbar zu machen + // Enable lines to guarantee that the object becomes visible aSet.Put(XLineStyleItem(XLINE_SOLID)); pPathObj->SetMergedItemSet(aSet); diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx index 8e2aa78acb39..a31523b47ebd 100644 --- a/svx/source/engine3d/obj3d.cxx +++ b/svx/source/engine3d/obj3d.cxx @@ -96,11 +96,8 @@ using namespace com::sun::star; -/************************************************************************* -|* -|* Liste fuer 3D-Objekte -|* -\************************************************************************/ + +// List for 3D-Objects TYPEINIT1(E3dObjList, SdrObjList); @@ -120,27 +117,26 @@ E3dObjList::~E3dObjList() void E3dObjList::NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos, const SdrInsertReason* pReason) { - // Owner holen - DBG_ASSERT(GetOwnerObj()->ISA(E3dObject), "AW: Einfuegen 3DObject in Parent != 3DObject"); + // Get owner + DBG_ASSERT(GetOwnerObj()->ISA(E3dObject), "Insert 3D object in parent != 3DObject"); - // Ist es ueberhaupt ein 3D-Objekt? + // Is it even a 3D object? if(pObj && pObj->ISA(E3dObject)) { - // Normales 3D Objekt, einfuegen mittels + // Normal 3D object, insert means // call parent SdrObjList::NbcInsertObject(pObj, nPos, pReason); } else { - // Kein 3D Objekt, fuege in Seite statt in Szene ein... + // No 3D object, inserted a page in place in a scene ... GetOwnerObj()->GetPage()->InsertObject(pObj, nPos); } } void E3dObjList::InsertObject(SdrObject* pObj, sal_uIntPtr nPos, const SdrInsertReason* pReason) { - OSL_ENSURE(GetOwnerObj()->ISA(E3dObject), "Insert 3DObject in non-3D Parent"); - //E3DModifySceneSnapRectUpdater aUpdater(GetOwnerObj()); + OSL_ENSURE(GetOwnerObj()->ISA(E3dObject), "Insert 3D object in non-3D Parent"); // call parent SdrObjList::InsertObject(pObj, nPos, pReason); @@ -154,8 +150,7 @@ void E3dObjList::InsertObject(SdrObject* pObj, sal_uIntPtr nPos, const SdrInsert SdrObject* E3dObjList::NbcRemoveObject(sal_uIntPtr nObjNum) { - DBG_ASSERT(GetOwnerObj()->ISA(E3dObject), "AW: Entfernen 3DObject aus Parent != 3DObject"); - //E3DModifySceneSnapRectUpdater aUpdater(GetOwnerObj()); + DBG_ASSERT(GetOwnerObj()->ISA(E3dObject), "Remove 3D object from Parent != 3DObject"); // call parent SdrObject* pRetval = SdrObjList::NbcRemoveObject(nObjNum); @@ -171,8 +166,7 @@ SdrObject* E3dObjList::NbcRemoveObject(sal_uIntPtr nObjNum) SdrObject* E3dObjList::RemoveObject(sal_uIntPtr nObjNum) { - OSL_ENSURE(GetOwnerObj()->ISA(E3dObject), "3DObject is removed from non-3D Parent"); - //E3DModifySceneSnapRectUpdater aUpdater(GetOwnerObj()); + OSL_ENSURE(GetOwnerObj()->ISA(E3dObject), "3D object is removed from non-3D Parent"); // call parent SdrObject* pRetval = SdrObjList::RemoveObject(nObjNum); @@ -186,12 +180,6 @@ SdrObject* E3dObjList::RemoveObject(sal_uIntPtr nObjNum) return pRetval; } -/************************************************************************* -|* -|* Konstruktor -|* -\************************************************************************/ - ////////////////////////////////////////////////////////////////////////////// sdr::properties::BaseProperties* E3dObject::CreateObjectSpecificProperties() @@ -199,7 +187,7 @@ sdr::properties::BaseProperties* E3dObject::CreateObjectSpecificProperties() return new sdr::properties::E3dProperties(*this); } -//////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// TYPEINIT1(E3dObject, SdrAttrObj); @@ -217,22 +205,10 @@ E3dObject::E3dObject() bClosedObj = true; } -/************************************************************************* -|* -|* Destruktor -|* -\************************************************************************/ - E3dObject::~E3dObject() { } -/************************************************************************* -|* -|* Selektions-Flag setzen -|* -\************************************************************************/ - void E3dObject::SetSelected(bool bNew) { if((bool)mbIsSelected != bNew) @@ -251,11 +227,7 @@ void E3dObject::SetSelected(bool bNew) } } -/************************************************************************* -|* -|* Aufbrechen, default-Implementierungen -|* -\************************************************************************/ +// Break, default implementations sal_Bool E3dObject::IsBreakObjPossible() { @@ -267,11 +239,7 @@ SdrAttrObj* E3dObject::GetBreakObj() return 0L; } -/************************************************************************* -|* -|* SetRectsDirty muss ueber die lokale SdrSubList gehen -|* -\************************************************************************/ +// SetRectsDirty must be done through the local SdrSubList void E3dObject::SetRectsDirty(sal_Bool bNotMyself) { @@ -289,33 +257,17 @@ void E3dObject::SetRectsDirty(sal_Bool bNotMyself) } } -/************************************************************************* -|* -|* Inventor zurueckgeben -|* -\************************************************************************/ - sal_uInt32 E3dObject::GetObjInventor() const { return E3dInventor; } -/************************************************************************* -|* -|* Identifier zurueckgeben -|* -\************************************************************************/ - sal_uInt16 E3dObject::GetObjIdentifier() const { return E3D_OBJECT_ID; } -/************************************************************************* -|* -|* Faehigkeiten des Objektes feststellen -|* -\************************************************************************/ +// Determine the capabilities of the object void E3dObject::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const { @@ -338,25 +290,17 @@ void E3dObject::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const XFillStyle eFillStyle = ((XFillStyleItem&)(GetMergedItem(XATTR_FILLSTYLE))).GetValue(); rInfo.bGradientAllowed = (eFillStyle == XFILL_GRADIENT); - // Umwandeln von 3D-Koerpern in Gruppe von Polygonen: - // - // Erst mal nicht moeglich, da die Erzeugung einer Gruppe von - // 2D-Polygonen notwendig waere, die tiefensortiert werden muessten, - // also bei Durchdringugnen auch gegeneinander geschnitten werden - // muessten. Auch die Texturkoorinaten waeren ein ungeloestes - // Problem. + // Convert 3D objects in a group of polygons: + // At first not only possible, because the creation of a group of + // 2D polygons would be required which need to be sorted by depth, + // ie at intersections be cut relative to each other. Also the texture + // coorinates were an unsolved problem. rInfo.bCanConvToPoly = sal_False; rInfo.bCanConvToContour = sal_False; rInfo.bCanConvToPathLineToArea = sal_False; rInfo.bCanConvToPolyLineToArea = sal_False; } -/************************************************************************* -|* -|* Layer setzen -|* -\************************************************************************/ - void E3dObject::NbcSetLayer(SdrLayerID nLayer) { SdrAttrObj::NbcSetLayer(nLayer); @@ -372,11 +316,7 @@ void E3dObject::NbcSetLayer(SdrLayerID nLayer) } } -/************************************************************************* -|* -|* ObjList auch an SubList setzen -|* -\************************************************************************/ +// Set ObjList also on SubList void E3dObject::SetObjList(SdrObjList* pNewObjList) { @@ -384,39 +324,23 @@ void E3dObject::SetObjList(SdrObjList* pNewObjList) maSubList.SetUpList(pNewObjList); } -/************************************************************************* -|* -|* Layer setzen -|* -\************************************************************************/ - void E3dObject::SetPage(SdrPage* pNewPage) { SdrAttrObj::SetPage(pNewPage); maSubList.SetPage(pNewPage); } -/************************************************************************* -|* -|* Layer setzen -|* -\************************************************************************/ - void E3dObject::SetModel(SdrModel* pNewModel) { SdrAttrObj::SetModel(pNewModel); maSubList.SetModel(pNewModel); } -/************************************************************************* -|* -|* resize object, used from old 2d interfaces, e.g. in Move/Scale dialog -|* (F4) -|* -\************************************************************************/ +// resize object, used from old 2d interfaces, e.g. in Move/Scale dialog (F4) + void E3dObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) { - // Bewegung in X,Y im Augkoordinatensystem + // Movement in X, Y in the eye coordinate system E3dScene* pScene = GetScene(); if(pScene) @@ -436,7 +360,7 @@ void E3dObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti aInverseViewToEye.invert(); aScaleCenter3D = aInverseViewToEye * aScaleCenter3D; - // scale-faktoren holen + // Get scale factors double fScaleX(xFact); double fScaleY(yFact); @@ -454,7 +378,7 @@ void E3dObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti mFullTransform.invert(); mTrans *= mFullTransform; - // anwenden + // Apply basegfx::B3DHomMatrix mObjTrans(GetTransform()); mObjTrans *= mTrans; @@ -463,22 +387,19 @@ void E3dObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti } } -/************************************************************************* -|* -|* Objekt verschieben in 2D, wird bei Cursortasten benoetigt -|* -\************************************************************************/ + +// Move object in 2D is needed when using cursor keys + void E3dObject::NbcMove(const Size& rSize) { - // Bewegung in X,Y im Augkoordinatensystem + // Movement in X, Y in the eye coordinate system E3dScene* pScene = GetScene(); if(pScene) { - // Abmessungen der Szene in 3D und 2D als Vergleich + //Dimensions of the scene in 3D and 2D for comparison Rectangle aRect = pScene->GetSnapRect(); - // Transformation Weltkoordinaten bis eine VOR Objektkoordinaten holen basegfx::B3DHomMatrix mInvDispTransform; if(GetParentObj()) { @@ -499,7 +420,7 @@ void E3dObject::NbcMove(const Size& rSize) 0.0); basegfx::B3DPoint aPos(0.0, 0.0, 0.0); - // movement vektor to local coordinates of objects' parent + // movement vector to local coordinates of objects' parent basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation()); aInverseOrientation.invert(); basegfx::B3DHomMatrix aCompleteTrans(mInvDispTransform * aInverseOrientation); @@ -516,23 +437,13 @@ void E3dObject::NbcMove(const Size& rSize) } } -/************************************************************************* -|* -|* liefere die Sublist, aber nur dann, wenn darin Objekte enthalten sind ! -|* -\************************************************************************/ +// Return the sublist, but only if it contains objects! SdrObjList* E3dObject::GetSubList() const { return &(const_cast< E3dObjList& >(maSubList)); } -/************************************************************************* -|* -|* SnapRect berechnen -|* -\************************************************************************/ - void E3dObject::RecalcSnapRect() { maSnapRect = Rectangle(); @@ -548,13 +459,8 @@ void E3dObject::RecalcSnapRect() } } -/************************************************************************* -|* -|* Einfuegen eines 3D-Objekts an den Parent weitermelden, damit dieser -|* ggf. eine Sonderbehandlung fuer spezielle Objekte durchfuehren kann -|* (z.B. Light/Label in E3dScene) -|* -\************************************************************************/ +// Inform the parent about insertion of a 3D object, so that the parent is able +// treat the particualar objects in a special way (eg Light / Label in E3dScene) void E3dObject::NewObjectInserted(const E3dObject* p3DObj) { @@ -562,13 +468,8 @@ void E3dObject::NewObjectInserted(const E3dObject* p3DObj) GetParentObj()->NewObjectInserted(p3DObj); } -/************************************************************************* -|* -|* Parent ueber Aenderung der Struktur (z.B. durch Transformation) -|* informieren; dabei wird das Objekt, in welchem die Aenderung -|* aufgetreten ist, uebergeben -|* -\************************************************************************/ +// Inform parent of changes in the structure (eg by transformation), in this +// process the object in which the change has occurred is returned. void E3dObject::StructureChanged() { @@ -579,15 +480,9 @@ void E3dObject::StructureChanged() } } -/************************************************************************* -|* -|* 3D-Objekt einfuegen -|* -\************************************************************************/ - void E3dObject::Insert3DObj(E3dObject* p3DObj) { - DBG_ASSERT(p3DObj, "Insert3DObj mit NULL-Zeiger!"); + DBG_ASSERT(p3DObj, "Insert3DObj with NULL-pointer!"); SdrPage* pPg = pPage; maSubList.InsertObject(p3DObj); pPage = pPg; @@ -598,7 +493,7 @@ void E3dObject::Insert3DObj(E3dObject* p3DObj) void E3dObject::Remove3DObj(E3dObject* p3DObj) { - DBG_ASSERT(p3DObj, "Remove3DObj mit NULL-Zeiger!"); + DBG_ASSERT(p3DObj, "Remove3DObj with NULL-pointer!"); if(p3DObj->GetParentObj() == this) { @@ -611,12 +506,6 @@ void E3dObject::Remove3DObj(E3dObject* p3DObj) } } -/************************************************************************* -|* -|* Parent holen -|* -\************************************************************************/ - E3dObject* E3dObject::GetParentObj() const { E3dObject* pRetval = NULL; @@ -628,11 +517,7 @@ E3dObject* E3dObject::GetParentObj() const return pRetval; } -/************************************************************************* -|* -|* Uebergeordnetes Szenenobjekt bestimmen -|* -\************************************************************************/ +// Determine the top-level scene object E3dScene* E3dObject::GetScene() const { @@ -641,11 +526,7 @@ E3dScene* E3dObject::GetScene() const return NULL; } -/************************************************************************* -|* -|* umschliessendes Volumen inklusive aller Kindobjekte berechnen -|* -\************************************************************************/ +// Calculate enclosed volume, including all child objects basegfx::B3DRange E3dObject::RecalcBoundVolume() const { @@ -690,11 +571,7 @@ basegfx::B3DRange E3dObject::RecalcBoundVolume() const return aRetval; } -/************************************************************************* -|* -|* umschliessendes Volumen zurueckgeben und ggf. neu berechnen -|* -\************************************************************************/ +// Get enclosed volume and possibly recalculate it const basegfx::B3DRange& E3dObject::GetBoundVolume() const { @@ -711,11 +588,7 @@ void E3dObject::InvalidateBoundVolume() maLocalBoundVol.reset(); } -/************************************************************************* -|* -|* Aederung des BoundVolumes an alle Kindobjekte weitergeben -|* -\************************************************************************/ +// Pass on the changes of the BoundVolumes to all child objects void E3dObject::SetBoundVolInvalid() { @@ -732,11 +605,7 @@ void E3dObject::SetBoundVolInvalid() } } -/************************************************************************* -|* -|* Aederung der Transformation an alle Kindobjekte weitergeben -|* -\************************************************************************/ +// Pass on the changes in transformation to all child objects void E3dObject::SetTransformChanged() { @@ -754,12 +623,8 @@ void E3dObject::SetTransformChanged() } } -/************************************************************************* -|* -|* hierarchische Transformation ueber alle Parents bestimmen, in -|* maFullTransform ablegen und diese zurueckgeben -|* -\************************************************************************/ +// Define the hierarchical transformation over all Parents, store in +// maFullTransform and return them const basegfx::B3DHomMatrix& E3dObject::GetFullTransform() const { @@ -779,23 +644,11 @@ const basegfx::B3DHomMatrix& E3dObject::GetFullTransform() const return maFullTransform; } -/************************************************************************* -|* -|* Transformationsmatrix abfragen -|* -\************************************************************************/ - const basegfx::B3DHomMatrix& E3dObject::GetTransform() const { return maTransformation; } -/************************************************************************* -|* -|* Transformationsmatrix setzen -|* -\************************************************************************/ - void E3dObject::NbcSetTransform(const basegfx::B3DHomMatrix& rMatrix) { if(maTransformation != rMatrix) @@ -806,17 +659,12 @@ void E3dObject::NbcSetTransform(const basegfx::B3DHomMatrix& rMatrix) } } -/************************************************************************* -|* -|* Transformationsmatrix setzen mit Repaint-Broadcast -|* -\************************************************************************/ +// Set transformation matrix with repaint broadcast void E3dObject::SetTransform(const basegfx::B3DHomMatrix& rMatrix) { if(rMatrix != maTransformation) { - // #110094#-14 SendRepaintBroadcast(); NbcSetTransform(rMatrix); SetChanged(); BroadcastObjectChange(); @@ -824,24 +672,13 @@ void E3dObject::SetTransform(const basegfx::B3DHomMatrix& rMatrix) } } -/************************************************************************* -|* -|* Linien fuer die Wireframe-Darstellung des Objekts dem uebergebenen -|* basegfx::B3DPolygon hinzufuegen -|* -\************************************************************************/ - basegfx::B3DPolyPolygon E3dObject::CreateWireframe() const { const basegfx::B3DRange aBoundVolume(GetBoundVolume()); return basegfx::tools::createCubePolyPolygonFromB3DRange(aBoundVolume); } -/************************************************************************* -|* -|* Get the name of the object (singular) -|* -\************************************************************************/ +// Get the name of the object (singular) void E3dObject::TakeObjNameSingul(XubString& rName) const { @@ -857,11 +694,7 @@ void E3dObject::TakeObjNameSingul(XubString& rName) const } } -/************************************************************************* -|* -|* Get the name of the object (plural) -|* -\************************************************************************/ +// Get the name of the object (plural) void E3dObject::TakeObjNamePlural(XubString& rName) const { @@ -873,12 +706,6 @@ E3dObject* E3dObject::Clone() const return CloneHelper< E3dObject >(); } -/************************************************************************* -|* -|* Zuweisungsoperator -|* -\************************************************************************/ - E3dObject& E3dObject::operator=(const E3dObject& rObj) { if( this == &rObj ) @@ -891,38 +718,24 @@ E3dObject& E3dObject::operator=(const E3dObject& rObj) maSubList.CopyObjects(*r3DObj.GetSubList()); } - // BoundVol kann uebernommen werden, da die Childs auch kopiert werden + // BoundVol can be copied since also the children are copied maLocalBoundVol = r3DObj.maLocalBoundVol; maTransformation = r3DObj.maTransformation; - // Da sich der Parent geaendert haben kann, Gesamttransformation beim - // naechsten Mal auf jeden Fall neu bestimmen + // Because the parent may have changed, definitely redefine the total + // transformation next time SetTransformChanged(); - // Selektionsstatus kopieren + // Copy selection status mbIsSelected = r3DObj.mbIsSelected; return *this; } -/************************************************************************* -|* -|* erstelle neues GeoData-Objekt -|* -\************************************************************************/ - SdrObjGeoData *E3dObject::NewGeoData() const { - // Theoretisch duerfen auch nur Szenen ihre GeoDatas erstellen und verwalten !! - // AW: Dies stimmt nicht mehr, diese Stelle ist mit der neuen Engine OK! return new E3DObjGeoData; } -/************************************************************************* -|* -|* uebergebe aktuelle werte an das GeoData-Objekt -|* -\************************************************************************/ - void E3dObject::SaveGeoData(SdrObjGeoData& rGeo) const { SdrAttrObj::SaveGeoData (rGeo); @@ -931,12 +744,6 @@ void E3dObject::SaveGeoData(SdrObjGeoData& rGeo) const ((E3DObjGeoData &) rGeo).maTransformation = maTransformation; } -/************************************************************************* -|* -|* uebernehme werte aus dem GeoData-Objekt -|* -\************************************************************************/ - void E3dObject::RestGeoData(const SdrObjGeoData& rGeo) { maLocalBoundVol = ((E3DObjGeoData &) rGeo).maLocalBoundVol; @@ -945,34 +752,29 @@ void E3dObject::RestGeoData(const SdrObjGeoData& rGeo) SdrAttrObj::RestGeoData (rGeo); } -/************************************************************************* -|* -|* Rotation eines 3d-Koerpers -|* -\************************************************************************/ -// 2D-rotation eines 3D-Koerpers, normalerweise macht das die Szene selbst -// Ist aber eine korrekte Implementierung, denn alles was passiert ist eine -// Rotation um die Achse die senkrecht auf dem Bildschirm steht und zwar -// unabhaengig davon, wie die Szene bisher gedreht worden ist. +// 2D-rotation of a 3D-body, normally this is done by the scene itself. +// This is however a correct implementation, because everything that has +// happened is a rotation around the axis perpendicular to the screen and that +// is regardless of how the scene has been rotated up until now. void E3dObject::NbcRotate(const Point& rRef, long nWink, double sn, double cs) { - // Also derzeit sind die Klebepunkte relativ zum aOutRect der Szene definiert. Vor dem Drehen - // werden die Klebepunkte relativ zur Seite definiert. Sie nehmen an der Drehung der Szene noch nicht Teil - // dafuer gibt es den - SetGlueReallyAbsolute(sal_True); + // So currently the glue points are defined relative to the scene aOutRect. + // Before turning the glue points are defined relative to the page. They + // take no part in the rotation of the scene. To ensure this, there is the + // SetGlueReallyAbsolute(sal_True); - // SendRepaintBroadcast(); double fWinkelInRad = nWink/100 * F_PI180; basegfx::B3DHomMatrix aRotateZ; aRotateZ.rotate(0.0, 0.0, fWinkelInRad); NbcSetTransform(aRotateZ * GetTransform()); - SetRectsDirty(); // Veranlasst eine Neuberechnung aller BoundRects - NbcRotateGluePoints(rRef,nWink,sn,cs); // Rotiert die Klebepunkte (die haben noch Koordinaten relativ - // zum Urpsung des Blattes - SetGlueReallyAbsolute(sal_False); // ab jetzt sind sie wieder relativ zum BoundRect (also dem aOutRect definiert) + SetRectsDirty(); // This forces a recalculation of all BoundRects + NbcRotateGluePoints(rRef,nWink,sn,cs); // Rotate the glue points (who still + // have coordinates relative to the + // original page) + SetGlueReallyAbsolute(sal_False); // from now they are again relative to BoundRect (that is defined as aOutRect) } /*************************************************************************/ @@ -984,23 +786,17 @@ sdr::properties::BaseProperties* E3dCompoundObject::CreateObjectSpecificProperti return new sdr::properties::E3dCompoundProperties(*this); } -//////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// TYPEINIT1(E3dCompoundObject, E3dObject); -/************************************************************************* -|* -|* Konstruktor -|* -\************************************************************************/ - E3dCompoundObject::E3dCompoundObject() : E3dObject(), aMaterialAmbientColor(), bCreateNormals(false), bCreateTexture(false) { - // Defaults setzen + // Set defaults E3dDefaultAttributes aDefault; SetDefaultAttributes(aDefault); } @@ -1011,35 +807,23 @@ E3dCompoundObject::E3dCompoundObject(E3dDefaultAttributes& rDefault) bCreateNormals(false), bCreateTexture(false) { - // Defaults setzen + // Set defaults SetDefaultAttributes(rDefault); } void E3dCompoundObject::SetDefaultAttributes(E3dDefaultAttributes& rDefault) { - // Defaults setzen + // Set defaults aMaterialAmbientColor = rDefault.GetDefaultAmbientColor(); bCreateNormals = rDefault.GetDefaultCreateNormals(); bCreateTexture = rDefault.GetDefaultCreateTexture(); } -/************************************************************************* -|* -|* Destruktor -|* -\************************************************************************/ - E3dCompoundObject::~E3dCompoundObject () { } -/************************************************************************* -|* -|* Drag-Polygon zurueckgeben -|* -\************************************************************************/ - basegfx::B2DPolyPolygon E3dCompoundObject::TakeXorPoly() const { basegfx::B2DPolyPolygon aRetval; @@ -1059,24 +843,12 @@ basegfx::B2DPolyPolygon E3dCompoundObject::TakeXorPoly() const return aRetval; } -/************************************************************************* -|* -|* Anzahl der Handles zurueckgeben -|* -\************************************************************************/ - sal_uInt32 E3dCompoundObject::GetHdlCount() const { - // 8 Eckpunkte + 1 E3dVolumeMarker (= Wireframe-Darstellung) + // 8 corners + 1 E3dVolumeMarker (= Wireframe representation) return 9L; } -/************************************************************************* -|* -|* Handle-Liste fuellen -|* -\************************************************************************/ - void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const { const uno::Sequence< beans::PropertyValue > aEmptyParameters; @@ -1130,23 +902,11 @@ void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const } } -/************************************************************************* -|* -|* Identifier zurueckgeben -|* -\************************************************************************/ - sal_uInt16 E3dCompoundObject::GetObjIdentifier() const { return E3D_COMPOUNDOBJ_ID; } -/************************************************************************* -|* -|* SnapRect berechnen -|* -\************************************************************************/ - void E3dCompoundObject::RecalcSnapRect() { const uno::Sequence< beans::PropertyValue > aEmptyParameters; @@ -1196,12 +956,6 @@ E3dCompoundObject* E3dCompoundObject::Clone() const return CloneHelper< E3dCompoundObject >(); } -/************************************************************************* -|* -|* Parameter Geometrieerzeugung setzen -|* -\************************************************************************/ - void E3dCompoundObject::SetCreateNormals(sal_Bool bNew) { if(bCreateNormals != bNew) @@ -1220,11 +974,7 @@ void E3dCompoundObject::SetCreateTexture(sal_Bool bNew) } } -/************************************************************************* -|* -|* Material des Objektes -|* -\************************************************************************/ +// Material of the object void E3dCompoundObject::SetMaterialAmbientColor(const Color& rColor) { @@ -1234,11 +984,7 @@ void E3dCompoundObject::SetMaterialAmbientColor(const Color& rColor) } } -/************************************************************************* -|* -|* convert given basegfx::B3DPolyPolygon to screen coor -|* -\************************************************************************/ +// convert given basegfx::B3DPolyPolygon to screen coor basegfx::B2DPolyPolygon E3dCompoundObject::TransformToScreenCoor(const basegfx::B3DPolyPolygon& rCandidate) { diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx index 8e29358c14f9..83797deb1f40 100644 --- a/svx/source/engine3d/objfac3d.cxx +++ b/svx/source/engine3d/objfac3d.cxx @@ -39,12 +39,6 @@ #include "svx/objfac3d.hxx" #include <svx/svdobj.hxx> -/************************************************************************* -|* -|* Konstruktor -|* -\************************************************************************/ - static sal_Bool bInit = sal_False; E3dObjFactory::E3dObjFactory() @@ -56,21 +50,11 @@ E3dObjFactory::E3dObjFactory() } } -/************************************************************************* -|* -|* Destruktor -|* -\************************************************************************/ - E3dObjFactory::~E3dObjFactory() { } -/************************************************************************* -|* -|* Chart-interne Objekte erzeugen -|* -\************************************************************************/ +// Generate chart internal objects IMPL_LINK( E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory) { @@ -88,10 +72,11 @@ IMPL_LINK( E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory) pObjFactory->pNewObj = new E3dCubeObj(); break; case E3D_SPHEREOBJ_ID: - // FG: ruft den dummy constructor, da dieser Aufruf nur beim Laden von Dokumenten erfolgt. - // die wirkliche Anzahkl Segmente wird aber erst nach dem Laden der Member festgelegt. - // dies hat zur Folge das die erste Kugel gleich wieder zerstoert wird, obwohl sie nie - // gebraucht worden ist. + // Gets the dummy constructor, as this is only called when + // loading documents. The actual number of segments is however + // determined only after loading the members. This will result + // in that the first sphere will be immediately destroyed, + // although it was never used. pObjFactory->pNewObj = new E3dSphereObj(123); break; case E3D_EXTRUDEOBJ_ID: diff --git a/svx/source/engine3d/polygn3d.cxx b/svx/source/engine3d/polygn3d.cxx index 00f3c4432c85..008ab42bf165 100644 --- a/svx/source/engine3d/polygn3d.cxx +++ b/svx/source/engine3d/polygn3d.cxx @@ -39,19 +39,13 @@ TYPEINIT1(E3dPolygonObj, E3dCompoundObject); ////////////////////////////////////////////////////////////////////////////// -// #110094# DrawContact section +// DrawContact section sdr::contact::ViewContact* E3dPolygonObj::CreateObjectSpecificViewContact() { return new sdr::contact::ViewContactOfE3dPolygon(*this); } -/************************************************************************* -|* -|* Konstruktor -|* -\************************************************************************/ - E3dPolygonObj::E3dPolygonObj( E3dDefaultAttributes& rDefault, const basegfx::B3DPolyPolygon& rPolyPoly3D, @@ -59,22 +53,16 @@ E3dPolygonObj::E3dPolygonObj( : E3dCompoundObject(rDefault), bLineOnly(bLinOnly) { - // Geometrie setzen + // Set geometry SetPolyPolygon3D(rPolyPoly3D); - // Default-Normals erzeugen + // Create default normals CreateDefaultNormals(); - // Default-Texturkoordinaten erzeugen + // Create default texture coordinates CreateDefaultTexture(); } -/************************************************************************* -|* -|* Konstruktor -|* -\************************************************************************/ - E3dPolygonObj::E3dPolygonObj( E3dDefaultAttributes& rDefault, const basegfx::B3DPolyPolygon& rPolyPoly3D, @@ -83,20 +71,14 @@ E3dPolygonObj::E3dPolygonObj( : E3dCompoundObject(rDefault), bLineOnly(bLinOnly) { - // Geometrie und Normalen setzen + // Set geometry and the normal SetPolyPolygon3D(rPolyPoly3D); SetPolyNormals3D(rPolyNormals3D); - // Default-Texturkoordinaten erzeugen + // Create default texture coordinates CreateDefaultTexture(); } -/************************************************************************* -|* -|* Konstruktor -|* -\************************************************************************/ - E3dPolygonObj::E3dPolygonObj( E3dDefaultAttributes& rDefault, const basegfx::B3DPolyPolygon& rPolyPoly3D, @@ -111,105 +93,85 @@ E3dPolygonObj::E3dPolygonObj( SetPolyTexture2D(rPolyTexture2D); } -/************************************************************************* -|* -|* Leer-Konstruktor -|* -\************************************************************************/ - E3dPolygonObj::E3dPolygonObj() : E3dCompoundObject(), bLineOnly(false) // added missing initialisation { - // Keine Geometrie erzeugen + // Create no geometry } -/************************************************************************* -|* -|* Default-Normalen erzeugen -|* -\************************************************************************/ - void E3dPolygonObj::CreateDefaultNormals() { basegfx::B3DPolyPolygon aPolyNormals; - // Komplettes PolyPolygon mit den Ebenennormalen anlegen + // Create a complete PolyPolygon with the plane normal for(sal_uInt32 a(0L); a < aPolyPoly3D.count(); a++) { - // Quellpolygon finden + // Find source polygon const basegfx::B3DPolygon aPolygon(aPolyPoly3D.getB3DPolygon(a)); - // Neues Polygon fuer Normalen anlegen + // Creating a new polygon for the normal basegfx::B3DPolygon aNormals; - // Normale holen (und umdrehen) + // Get normal (and invert) basegfx::B3DVector aNormal(-basegfx::tools::getNormal(aPolygon)); - // Neues Polygon fuellen + // Fill new polygon for(sal_uInt32 b(0L); b < aPolygon.count(); b++) { aNormals.append(aNormal); } - // Neues Polygon in PolyPolygon einfuegen + // Insert new polygon into the PolyPolygon aPolyNormals.append(aNormals); } - // Default-Normalen setzen + // Set default normal SetPolyNormals3D(aPolyNormals); } -/************************************************************************* -|* -|* Default-Texturkoordinaten erzeugen -|* -\************************************************************************/ - void E3dPolygonObj::CreateDefaultTexture() { basegfx::B2DPolyPolygon aPolyTexture; - - // Komplettes PolyPolygon mit den Texturkoordinaten anlegen - // Die Texturkoordinaten erstrecken sich ueber X,Y und Z - // ueber die gesamten Extremwerte im Bereich 0.0 .. 1.0 + // Create a complete PolyPolygon with the texture coordinates + // The texture coordinates extend over X,Y and Z + // on the whole extreme values in the range 0.0 .. 1.0 for(sal_uInt32 a(0L); a < aPolyPoly3D.count(); a++) { - // Quellpolygon finden + // Find source polygon const basegfx::B3DPolygon& aPolygon(aPolyPoly3D.getB3DPolygon(a)); - // Gesamtgroesse des Objektes feststellen + // Determine the total size of the object basegfx::B3DRange aVolume(basegfx::tools::getRange(aPolygon)); - // Normale holen + // Get normal basegfx::B3DVector aNormal(basegfx::tools::getNormal(aPolygon)); aNormal.setX(fabs(aNormal.getX())); aNormal.setY(fabs(aNormal.getY())); aNormal.setZ(fabs(aNormal.getZ())); - // Entscheiden, welche Koordinaten als Source fuer das - // Mapping benutzt werden sollen + // Decide which coordinates should be used as a source for the mapping sal_uInt16 nSourceMode = 0; - // Groessten Freiheitsgrad ermitteln + // Determine the greatest degree of freedom if(!(aNormal.getX() > aNormal.getY() && aNormal.getX() > aNormal.getZ())) { if(aNormal.getY() > aNormal.getZ()) { - // Y ist am groessten, benutze X,Z als mapping + // Y is the largest, use X,Z as mapping nSourceMode = 1; } else { - // Z ist am groessten, benutze X,Y als mapping + // Z is the largest, use X,Y as mapping nSourceMode = 2; } } - // Neues Polygon fuer Texturkoordinaten anlegen + // Create new polygon for texture coordinates basegfx::B2DPolygon aTexture; - // Neues Polygon fuellen + // Fill new polygon for(sal_uInt32 b(0L); b < aPolygon.count(); b++) { basegfx::B2DPoint aTex; @@ -217,21 +179,21 @@ void E3dPolygonObj::CreateDefaultTexture() switch(nSourceMode) { - case 0: // Quelle ist Y,Z + case 0: //Source is Y,Z if(aVolume.getHeight()) aTex.setX((aCandidate.getY() - aVolume.getMinY()) / aVolume.getHeight()); if(aVolume.getDepth()) aTex.setY((aCandidate.getZ() - aVolume.getMinZ()) / aVolume.getDepth()); break; - case 1: // Quelle ist X,Z + case 1: // Source is X,Z if(aVolume.getWidth()) aTex.setX((aCandidate.getX() - aVolume.getMinX()) / aVolume.getWidth()); if(aVolume.getDepth()) aTex.setY((aCandidate.getZ() - aVolume.getMinZ()) / aVolume.getDepth()); break; - case 2: // Quelle ist X,Y + case 2: // Source is X,Y if(aVolume.getWidth()) aTex.setX((aCandidate.getX() - aVolume.getMinX()) / aVolume.getWidth()); if(aVolume.getHeight()) @@ -242,49 +204,31 @@ void E3dPolygonObj::CreateDefaultTexture() aTexture.append(aTex); } - // Neues Polygon in PolyPolygon einfuegen + // Insert new polygon into the PolyPolygon aPolyTexture.append(aTexture); } - // Default-Texturkoordinaten setzen + // Set default Texture coordinates SetPolyTexture2D(aPolyTexture); } -/************************************************************************* -|* -|* Destruktor -|* -\************************************************************************/ - E3dPolygonObj::~E3dPolygonObj() { } -/************************************************************************* -|* -|* Identifier zurueckgeben -|* -\************************************************************************/ - sal_uInt16 E3dPolygonObj::GetObjIdentifier() const { return E3D_POLYGONOBJ_ID; } -/************************************************************************* -|* -|* Polygon setzen -|* -\************************************************************************/ - void E3dPolygonObj::SetPolyPolygon3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D) { if ( aPolyPoly3D != rNewPolyPoly3D ) { - // Neues PolyPolygon; kopieren + // New PolyPolygon; copying aPolyPoly3D = rNewPolyPoly3D; - // Geometrie neu erzeugen + // Create new geometry ActionChanged(); } } @@ -293,10 +237,10 @@ void E3dPolygonObj::SetPolyNormals3D(const basegfx::B3DPolyPolygon& rNewPolyNorm { if ( aPolyNormals3D != rNewPolyNormals3D ) { - // Neue Normalen; kopieren + // New PolyPolygon; copying aPolyNormals3D = rNewPolyNormals3D; - // Geometrie neu erzeugen + // Create new geometry ActionChanged(); } } @@ -305,19 +249,15 @@ void E3dPolygonObj::SetPolyTexture2D(const basegfx::B2DPolyPolygon& rNewPolyText { if ( aPolyTexture2D != rNewPolyTexture2D ) { - // Neue Texturkoordinaten; kopieren + // New PolyPolygon; copying aPolyTexture2D = rNewPolyTexture2D; - // Geometrie neu erzeugen + // Create new geometry ActionChanged(); } } -/************************************************************************* -|* -|* Wandle das Objekt in ein Gruppenobjekt bestehend aus 6 Polygonen -|* -\************************************************************************/ +// Convert the object into a group object consisting of 6 polygons SdrObject *E3dPolygonObj::DoConvertToPolyObj(sal_Bool /*bBezier*/) const { @@ -329,12 +269,6 @@ E3dPolygonObj* E3dPolygonObj::Clone() const return CloneHelper< E3dPolygonObj >(); } -/************************************************************************* -|* -|* LineOnly setzen -|* -\************************************************************************/ - void E3dPolygonObj::SetLineOnly(sal_Bool bNew) { if(bNew != bLineOnly) diff --git a/svx/source/engine3d/polysc3d.cxx b/svx/source/engine3d/polysc3d.cxx index ab6f2686ae32..bd2b081c7112 100644 --- a/svx/source/engine3d/polysc3d.cxx +++ b/svx/source/engine3d/polysc3d.cxx @@ -61,12 +61,6 @@ E3dPolyScene::E3dPolyScene(E3dDefaultAttributes& rDefault) { } -/************************************************************************* -|* -|* Identifier zurueckgeben -|* -\************************************************************************/ - sal_uInt16 E3dPolyScene::GetObjIdentifier() const { return E3D_POLYSCENE_ID; diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 159daf97badc..1f9f7fde4b49 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -62,14 +62,13 @@ #define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue() ////////////////////////////////////////////////////////////////////////////// -// #110988# class ImpRemap3DDepth { sal_uInt32 mnOrdNum; double mfMinimalDepth; - // bitfield + // bit field unsigned mbIsScene : 1; public: @@ -125,7 +124,6 @@ bool ImpRemap3DDepth::operator<(const ImpRemap3DDepth& rComp) const typedef ::std::vector< ImpRemap3DDepth > ImpRemap3DDepthVector; ////////////////////////////////////////////////////////////////////////////// -// #110988# class Imp3DDepthRemapper { @@ -194,30 +192,24 @@ sdr::properties::BaseProperties* E3dScene::CreateObjectSpecificProperties() } ////////////////////////////////////////////////////////////////////////////// -// #110094# DrawContact section +// DrawContact section sdr::contact::ViewContact* E3dScene::CreateObjectSpecificViewContact() { return new sdr::contact::ViewContactOfE3dScene(*this); } -//////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// TYPEINIT1(E3dScene, E3dObject); -/************************************************************************* -|* -|* E3dScene-Konstruktor -|* -\************************************************************************/ - E3dScene::E3dScene() : E3dObject(), aCamera(basegfx::B3DPoint(0.0, 0.0, 4.0), basegfx::B3DPoint()), mp3DDepthRemapper(0L), bDrawOnlySelected(false) { - // Defaults setzen + // Set defaults E3dDefaultAttributes aDefault; SetDefaultAttributes(aDefault); } @@ -228,27 +220,27 @@ E3dScene::E3dScene(E3dDefaultAttributes& rDefault) mp3DDepthRemapper(0L), bDrawOnlySelected(false) { - // Defaults setzen + // Set defaults SetDefaultAttributes(rDefault); } void E3dScene::SetDefaultAttributes(E3dDefaultAttributes& /*rDefault*/) { - // Fuer OS/2 die FP-Exceptions abschalten + // For OS/2 turn off the FP-Exceptions #if defined(OS2) #define SC_FPEXCEPTIONS_ON() _control87( MCW_EM, 0 ) #define SC_FPEXCEPTIONS_OFF() _control87( MCW_EM, MCW_EM ) SC_FPEXCEPTIONS_OFF(); #endif - // Fuer WIN95/NT die FP-Exceptions abschalten + // For WIN95/NT turn off the FP-Exceptions #if defined(WNT) #define SC_FPEXCEPTIONS_ON() _control87( _MCW_EM, 0 ) #define SC_FPEXCEPTIONS_OFF() _control87( _MCW_EM, _MCW_EM ) SC_FPEXCEPTIONS_OFF(); #endif - // Defaults setzen + // Set defaults aCamera.SetViewWindow(-2, -2, 4, 4); aCameraSet.SetDeviceRectangle(-2, 2, -2, 2); aCamera.SetDeviceWindow(Rectangle(0, 0, 10, 10)); @@ -269,15 +261,8 @@ void E3dScene::SetDefaultAttributes(E3dDefaultAttributes& /*rDefault*/) aCamera.SetFocalLength(fNew); } -/************************************************************************* -|* -|* Destruktor -|* -\************************************************************************/ - E3dScene::~E3dScene() { - // #110988# ImpCleanup3DDepthMapper(); } @@ -294,7 +279,6 @@ basegfx::B2DPolyPolygon E3dScene::TakeXorPoly() const return aRetval; } -// #110988# void E3dScene::ImpCleanup3DDepthMapper() { if(mp3DDepthRemapper) @@ -304,7 +288,6 @@ void E3dScene::ImpCleanup3DDepthMapper() } } -// #110988# sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const { if(!mp3DDepthRemapper) @@ -325,12 +308,6 @@ sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const return nNewOrdNum; } -/************************************************************************* -|* -|* Identifier zurueckgeben -|* -\************************************************************************/ - sal_uInt16 E3dScene::GetObjIdentifier() const { return E3D_SCENE_ID; @@ -352,12 +329,6 @@ void E3dScene::SetBoundRectDirty() } } -/************************************************************************* -|* -|* SetSnapRect -|* -\************************************************************************/ - void E3dScene::NbcSetSnapRect(const Rectangle& rRect) { SetRectsDirty(); @@ -365,16 +336,9 @@ void E3dScene::NbcSetSnapRect(const Rectangle& rRect) aCamera.SetDeviceWindow(rRect); aCameraSet.SetViewportRectangle((Rectangle&)rRect); - // #110988# ImpCleanup3DDepthMapper(); } -/************************************************************************* -|* -|* Objekt verschieben -|* -\************************************************************************/ - void E3dScene::NbcMove(const Size& rSize) { Rectangle aNewSnapRect = GetSnapRect(); @@ -382,12 +346,6 @@ void E3dScene::NbcMove(const Size& rSize) NbcSetSnapRect(aNewSnapRect); } -/************************************************************************* -|* -|* Objekt Resizen -|* -\************************************************************************/ - void E3dScene::NbcResize(const Point& rRef, const Fraction& rXFact, const Fraction& rYFact) { @@ -396,51 +354,40 @@ void E3dScene::NbcResize(const Point& rRef, const Fraction& rXFact, NbcSetSnapRect(aNewSnapRect); } -/************************************************************************* -|* -|* Neue Kamera setzen, und dabei die Szene und ggf. das BoundVolume -|* als geaendert markieren -|* -\************************************************************************/ +// Set new camera, and thus mark the scene and if possible the bound volume +// as changed void E3dScene::SetCamera(const Camera3D& rNewCamera) { - // Alte Kamera setzen + // Set old camera aCamera = rNewCamera; ((sdr::properties::E3dSceneProperties&)GetProperties()).SetSceneItemsFromCamera(); SetRectsDirty(); - // Neue Kamera aus alter fuellen + // Fill new camera from old Camera3D& rCam = (Camera3D&)GetCamera(); - // Ratio abschalten + // Turn off ratio if(rCam.GetAspectMapping() == AS_NO_MAPPING) GetCameraSet().SetRatio(0.0); - // Abbildungsgeometrie setzen + // Set Imaging geometry basegfx::B3DPoint aVRP(rCam.GetViewPoint()); basegfx::B3DVector aVPN(aVRP - rCam.GetVRP()); basegfx::B3DVector aVUV(rCam.GetVUV()); - // #91047# use SetViewportValues() to set VRP, VPN and VUV as vectors, too. + // use SetViewportValues() to set VRP, VPN and VUV as vectors, too. // Else these values would not be exported/imported correctly. GetCameraSet().SetViewportValues(aVRP, aVPN, aVUV); - // Perspektive setzen + // Set perspective GetCameraSet().SetPerspective(rCam.GetProjection() == PR_PERSPECTIVE); GetCameraSet().SetViewportRectangle((Rectangle&)rCam.GetDeviceWindow()); - // #110988# ImpCleanup3DDepthMapper(); } -/************************************************************************* -|* -|* 3D-Objekt einfuegen -|* -\************************************************************************/ - void E3dScene::NewObjectInserted(const E3dObject* p3DObj) { E3dObject::NewObjectInserted(p3DObj); @@ -448,30 +395,20 @@ void E3dScene::NewObjectInserted(const E3dObject* p3DObj) if ( p3DObj == this ) return; - // #110988# ImpCleanup3DDepthMapper(); } -/************************************************************************* -|* -|* Parent ueber Aenderung eines Childs informieren -|* -\************************************************************************/ +// Inform parent of changes of a child void E3dScene::StructureChanged() { E3dObject::StructureChanged(); SetRectsDirty(); - // #110988# ImpCleanup3DDepthMapper(); } -/************************************************************************* -|* -|* Uebergeordnetes Szenenobjekt bestimmen -|* -\************************************************************************/ +// Determine the overall scene object E3dScene* E3dScene::GetScene() const { @@ -534,12 +471,6 @@ E3dScene* E3dScene::Clone() const return CloneHelper< E3dScene >(); } -/************************************************************************* -|* -|* Zuweisungsoperator -|* -\************************************************************************/ - E3dScene& E3dScene::operator=(const E3dScene& rObj) { if( this == &rObj ) @@ -549,16 +480,13 @@ E3dScene& E3dScene::operator=(const E3dScene& rObj) const E3dScene& r3DObj = (const E3dScene&) rObj; aCamera = r3DObj.aCamera; - // neu ab 377: aCameraSet = r3DObj.aCameraSet; ((sdr::properties::E3dSceneProperties&)GetProperties()).SetSceneItemsFromCamera(); - // SetSnapRect(r3DObj.GetSnapRect()); InvalidateBoundVolume(); RebuildLists(); SetRectsDirty(); - // #110988# ImpCleanup3DDepthMapper(); // #i101941# @@ -576,20 +504,16 @@ E3dScene& E3dScene::operator=(const E3dScene& rObj) return *this; } -/************************************************************************* -|* -|* Licht- und Labelobjektlisten neu aufbauen (nach Laden, Zuweisung) -|* -\************************************************************************/ +// Rebuild Light- and label- object lists rebuild (after loading, allocation) void E3dScene::RebuildLists() { - // zuerst loeschen + // first delete SdrLayerID nCurrLayerID = GetLayer(); SdrObjListIter a3DIterator(maSubList, IM_FLAT); - // dann alle Objekte in der Szene pruefen + // then examine all the objects in the scene while ( a3DIterator.IsMore() ) { E3dObject* p3DObj = (E3dObject*) a3DIterator.Next(); @@ -598,23 +522,11 @@ void E3dScene::RebuildLists() } } -/************************************************************************* -|* -|* erstelle neues GeoData-Objekt -|* -\************************************************************************/ - SdrObjGeoData *E3dScene::NewGeoData() const { return new E3DSceneGeoData; } -/************************************************************************* -|* -|* uebergebe aktuelle werte an das GeoData-Objekt -|* -\************************************************************************/ - void E3dScene::SaveGeoData(SdrObjGeoData& rGeo) const { E3dObject::SaveGeoData (rGeo); @@ -622,12 +534,6 @@ void E3dScene::SaveGeoData(SdrObjGeoData& rGeo) const ((E3DSceneGeoData &) rGeo).aCamera = aCamera; } -/************************************************************************* -|* -|* uebernehme werte aus dem GeoData-Objekt -|* -\************************************************************************/ - void E3dScene::RestGeoData(const SdrObjGeoData& rGeo) { // #i94832# removed E3DModifySceneSnapRectUpdater here. @@ -636,11 +542,7 @@ void E3dScene::RestGeoData(const SdrObjGeoData& rGeo) SetCamera (((E3DSceneGeoData &) rGeo).aCamera); } -/************************************************************************* -|* -|* Am StyleSheet wurde etwas geaendert, also Scene aendern -|* -\************************************************************************/ +// Something was changed in the style sheet, so change scene void E3dScene::Notify(SfxBroadcaster &rBC, const SfxHint &rHint) { @@ -648,10 +550,6 @@ void E3dScene::Notify(SfxBroadcaster &rBC, const SfxHint &rHint) E3dObject::Notify(rBC, rHint); } -/************************************************************************* -|* -\************************************************************************/ - void E3dScene::RotateScene (const Point& rRef, long /*nWink*/, double sn, double cs) { Point UpperLeft, LowerRight, Center, NewCenter; @@ -666,13 +564,14 @@ void E3dScene::RotateScene (const Point& rRef, long /*nWink*/, double sn, double Rectangle RectQuelle(aOutRect), RectZiel(aOutRect); - // Nur der Mittelpunkt wird bewegt. Die Ecken werden von NbcMove bewegt. - // Fuer das Drehen wird von mir ein kartesisches Koordinatensystem verwendet in dem der Drehpunkt - // der Nullpunkt ist und die Y- Achse nach oben ansteigt, die X-Achse nach rechts. - // Dies muss bei den Y-Werten beachtet werden. (Auf dem Blatt zeigt die Y-Achse nach unten + // Only the center is moved. The corners are moved by NbcMove. For the + // rotation a cartesian coordinate system is used in which the pivot + // point is the origin, and the y-axis increases upward, the X-axis to + // the right. This must be especially noted for the Y-values. + // (When considering a flat piece of paper the Y-axis pointing downwards Center.X() = (UpperLeft.X() + dxOutRectHalf) - rRef.X(); Center.Y() = -((UpperLeft.Y() + dyOutRectHalf) - rRef.Y()); - // Ein paar Spezialfaelle zuerst abhandeln (n*90 Grad n ganzzahlig) + // A few special cases has to be dealt with first (n * 90 degrees n integer) if (sn==1.0 && cs==0.0) { // 90deg NewCenter.X() = -Center.Y(); NewCenter.Y() = -Center.X(); @@ -683,11 +582,12 @@ void E3dScene::RotateScene (const Point& rRef, long /*nWink*/, double sn, double NewCenter.X() = Center.Y(); NewCenter.Y() = -Center.X(); } - else // Hier wird um einen beliebigen Winkel in mathematisch positiver Richtung gedreht! - { // xneu = x * cos(alpha) - y * sin(alpha) - // yneu = x * sin(alpha) + y * cos(alpha) - // Unten Rechts wird nicht gedreht: die Seiten von RectQuelle muessen parallel - // zu den Koordinatenachsen bleiben. + else // Here it is rotated to any angle in the mathematically + // positive direction! + { // xnew = x * cos(alpha) - y * sin(alpha) + // ynew = x * sin(alpha) + y * cos(alpha) + // Bottom Right is not rotated: the pages of RectQuelle must + // remain parallel to the coordinate axes. NewCenter.X() = (long) (Center.X() * cs - Center.Y() * sn); NewCenter.Y() = (long) (Center.X() * sn + Center.Y() * cs); } @@ -695,16 +595,10 @@ void E3dScene::RotateScene (const Point& rRef, long /*nWink*/, double sn, double Size Differenz; Point DiffPoint = (NewCenter - Center); Differenz.Width() = DiffPoint.X(); - Differenz.Height() = -DiffPoint.Y(); // Man beachte dass die Y-Achse nach unten positiv gezaehlt wird. - NbcMove (Differenz); // fuehrt die eigentliche Koordinatentransformation durch. + Differenz.Height() = -DiffPoint.Y(); // Note that the Y-axis is counted ad positive downward. + NbcMove (Differenz); // Actually executes the coordinate transformation. } -/************************************************************************* -|* -|* Get the name of the object (singular) -|* -\************************************************************************/ - void E3dScene::TakeObjNameSingul(XubString& rName) const { rName=ImpGetResStr(STR_ObjNameSingulScene3d); @@ -719,24 +613,14 @@ void E3dScene::TakeObjNameSingul(XubString& rName) const } } -/************************************************************************* -|* -|* Get the name of the object (plural) -|* -\************************************************************************/ - void E3dScene::TakeObjNamePlural(XubString& rName) const { rName=ImpGetResStr(STR_ObjNamePluralScene3d); } -/************************************************************************* -|* -|* Die NbcRotate-Routine ueberlaedt die des SdrObject. Die Idee ist die Scene -|* drehen zu koennen und relativ zur Lage der Scene dann auch die Objekte -|* in der Scene -|* -\************************************************************************/ +// The NbcRotate routine overloads the one of the SdrObject. The idea is +// to be able to rotate the scene relative to the position of the scene +// and then the objects in the scene void E3dScene::NbcSetTransform(const basegfx::B3DHomMatrix& rMatrix) { @@ -758,72 +642,60 @@ void E3dScene::SetTransform(const basegfx::B3DHomMatrix& rMatrix) void E3dScene::NbcRotate(const Point& rRef, long nWink, double sn, double cs) { - // Also derzeit sind die Klebepunkte relativ zum aOutRect der Szene definiert. Vor dem Drehen - // werden die Klebepunkte relativ zur Seite definiert. Sie nehmen an der Drehung der Szene noch nicht Teil - // dafuer gibt es den - SetGlueReallyAbsolute(sal_True); + // So currently the glue points are defined relative to the scene aOutRect. + // Before turning the glue points are defined relative to the page. They + // take no part in the rotation of the scene. To ensure this, there is the + // SetGlueReallyAbsolute(sal_True); - // So dass war die Szene, ab jetzt kommen die Objekte in der Szene - // 3D-Objekte gibt es nur ein einziges das kann zwar mehrere Flaechen haben aber die Flaechen - // muessen ja nicht zusammenhaengend sein - // es ermoeglicht den Zugriff auf Kindobjekte - // Ich gehe also die gesamte Liste durch und rotiere um die Z-Achse die durch den - // Mittelpunkt von aOutRect geht (Satz von Steiner), also RotateZ + // So that was the scene, now the objects used in the scene + // 3D objects, if there is only one it can still have multiple surfaces but + // the surfaces do not hve to be connected. This allows you to access child + // objects. So going through the entire list and rotate around the Z axis + // through the enter of aOutRect's (Steiner's theorem), so RotateZ - RotateScene (rRef, nWink, sn, cs); // Rotiert die Szene + RotateScene (rRef, nWink, sn, cs); // Rotates the scene double fWinkelInRad = nWink/100 * F_PI180; basegfx::B3DHomMatrix aRotation; aRotation.rotate(0.0, 0.0, fWinkelInRad); NbcSetTransform(aRotation * GetTransform()); - SetRectsDirty(); // Veranlasst eine Neuberechnung aller BoundRects - NbcRotateGluePoints(rRef,nWink,sn,cs); // Rotiert die Klebepunkte (die haben noch Koordinaten relativ - // zum Urpsung des Blattes - SetGlueReallyAbsolute(sal_False); // ab jetzt sind sie wieder relativ zum BoundRect (also dem aOutRect definiert) + SetRectsDirty(); // This forces a recalculation of all BoundRects + NbcRotateGluePoints(rRef,nWink,sn,cs); // Rotate the glue points (who still + // have coordinates relative to the + // original page) + SetGlueReallyAbsolute(sal_False); // from now they are again relative to BoundRect (that is defined as aOutRect) SetRectsDirty(); } -/************************************************************************* -|* -|* SnapRect berechnen -|* -\************************************************************************/ - void E3dScene::RecalcSnapRect() { E3dScene* pScene = GetScene(); if(pScene == this) { - // Szene wird als 2D-Objekt benutzt, nimm SnapRect aus der - // 2D Bildschrimdarstellung + // The Scene is used as a 2D-Objekt, take the SnapRect from the + // 2D Display settings Camera3D& rCam = (Camera3D&)pScene->GetCamera(); maSnapRect = rCam.GetDeviceWindow(); } else { - // Szene ist selbst Mitglied einer anderen Szene, hole das - // SnapRect als zusammengesetztes Objekt + // The Scene itself is a member of another scene, get the SnapRect + // as a composite object E3dObject::RecalcSnapRect(); } } -/************************************************************************* -|* -|* Aufbrechen -|* -\************************************************************************/ - sal_Bool E3dScene::IsBreakObjPossible() { - // Szene ist aufzubrechen, wenn alle Mitglieder aufzubrechen sind + // Break scene, if all members are able to break SdrObjListIter a3DIterator(maSubList, IM_DEEPWITHGROUPS); while ( a3DIterator.IsMore() ) { E3dObject* pObj = (E3dObject*) a3DIterator.Next(); - DBG_ASSERT(pObj->ISA(E3dObject), "AW: In Szenen sind nur 3D-Objekte erlaubt!"); + DBG_ASSERT(pObj->ISA(E3dObject), "only 3D objects are allowed in scenes!"); if(!pObj->IsBreakObjPossible()) return sal_False; } diff --git a/svx/source/engine3d/sphere3d.cxx b/svx/source/engine3d/sphere3d.cxx index b847fa96c2ab..3b6ce894a9be 100644 --- a/svx/source/engine3d/sphere3d.cxx +++ b/svx/source/engine3d/sphere3d.cxx @@ -45,7 +45,7 @@ #include <basegfx/polygon/b3dpolygon.hxx> ////////////////////////////////////////////////////////////////////////////// -// #110094# DrawContact section +// DrawContact section sdr::contact::ViewContact* E3dSphereObj::CreateObjectSpecificViewContact() { @@ -63,19 +63,15 @@ sdr::properties::BaseProperties* E3dSphereObj::CreateObjectSpecificProperties() TYPEINIT1(E3dSphereObj, E3dCompoundObject); -/************************************************************************* -|* -|* Kugel aus Polygonfacetten nach Laengen und Breitengrad aufbauen -|* -\************************************************************************/ + +// Build Sphere from polygon facets in latitude and longitude E3dSphereObj::E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoint& rCenter, const basegfx::B3DVector& r3DSize) : E3dCompoundObject(rDefault) { - // Defaults setzen + // Set defaults SetDefaultAttributes(rDefault); - // Uebergebene drueberbuegeln aCenter = rCenter; aSize = r3DSize; } @@ -83,63 +79,47 @@ E3dSphereObj::E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoi E3dSphereObj::E3dSphereObj() : E3dCompoundObject() { - // Defaults setzen + // Set defaults E3dDefaultAttributes aDefault; SetDefaultAttributes(aDefault); } -/************************************************************************* -|* -|* Kugel erzeugen ohne die Polygone darin zu erzeugen -|* -\************************************************************************/ - -// FG: Dieser Aufruf erfolgt von der 3D-Object Factory (objfac3d.cxx) und zwar ausschliesslich beim -// laden von Dokumenten. Hier braucht man keinen CreateSphere-Aufruf, denn die wirkliche -// Anzahl Segmente ist ja noch nicht bekannt. Dies war bis zum 10.2.97 ein (kleines) -// Speicherleck. -E3dSphereObj::E3dSphereObj(int /*dummy*/) // den Parameter braucht es um unterscheiden zu koennen, welcher -{ // der beiden Konstruktoren gemeint ist. Der obige halt per Default - // Defaults setzen + +// Create Sphere without creating the Polygons within + +// This call is from the 3D Object Factory (objfac3d.cxx) and only when loading +// of documents. Here you do not need CreateSphere call, since the real number +// of segments is not even known yet. This was until 10.02.1997 a (small) +// memory leak. + +E3dSphereObj::E3dSphereObj(int /*dummy*/) +// the parameters it needs to be able to distinguish which +// constructors of the two is meant. The above is the default. +{ + // Set defaults E3dDefaultAttributes aDefault; SetDefaultAttributes(aDefault); } void E3dSphereObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault) { - // Defaults setzen + // Set defaults aCenter = rDefault.GetDefaultSphereCenter(); aSize = rDefault.GetDefaultSphereSize(); } -/************************************************************************* -|* -|* Identifier zurueckgeben -|* -\************************************************************************/ - sal_uInt16 E3dSphereObj::GetObjIdentifier() const { return E3D_SPHEREOBJ_ID; } -/************************************************************************* -|* -|* Wandle das Objekt in ein Gruppenobjekt bestehend aus n Polygonen -|* -\************************************************************************/ +// Convert the object into a group object consisting of n polygons SdrObject *E3dSphereObj::DoConvertToPolyObj(sal_Bool /*bBezier*/) const { return NULL; } -/************************************************************************* -|* -|* Leer-Konstruktor -|* -\************************************************************************/ - void E3dSphereObj::ReSegment(sal_uInt32 nHSegs, sal_uInt32 nVSegs) { if((nHSegs != GetHorizontalSegments() || nVSegs != GetVerticalSegments()) && (nHSegs != 0 || nVSegs != 0)) @@ -156,11 +136,7 @@ E3dSphereObj* E3dSphereObj::Clone() const return CloneHelper< E3dSphereObj >(); } -/************************************************************************* -|* -|* Lokale Parameter setzen mit Geometrieneuerzeugung -|* -\************************************************************************/ +// Set local parameters with geometry re-creating void E3dSphereObj::SetCenter(const basegfx::B3DPoint& rNew) { @@ -180,11 +156,7 @@ void E3dSphereObj::SetSize(const basegfx::B3DVector& rNew) } } -/************************************************************************* -|* -|* Get the name of the object (singular) -|* -\************************************************************************/ +// Get the name of the object (singular) void E3dSphereObj::TakeObjNameSingul(XubString& rName) const { @@ -200,11 +172,7 @@ void E3dSphereObj::TakeObjNameSingul(XubString& rName) const } } -/************************************************************************* -|* -|* Get the name of the object (plural) -|* -\************************************************************************/ +// Get the name of the object (plural) void E3dSphereObj::TakeObjNamePlural(XubString& rName) const { diff --git a/svx/source/engine3d/string3d.src b/svx/source/engine3d/string3d.src index fd5e662305f3..9d23adc147af 100644 --- a/svx/source/engine3d/string3d.src +++ b/svx/source/engine3d/string3d.src @@ -28,7 +28,7 @@ #include <svx/dialogs.hrc> // pragma ------------------------------------------------------------------- - // Strings fuer die Draw-Dialoge -------------------------------------------- + // Strings for the Draw Dialog -------------------------------------------- String RID_SVX_3D_CREATE_LATHE { Text [ en-US ] = "Create 3D rotation object" ; diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 9ac90d408085..08b2dc3ce4c0 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -82,7 +82,7 @@ TYPEINIT1(E3dView, SdrView); -//////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// // Migrate Marking class Impl3DMirrorConstructOverlay @@ -233,28 +233,18 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr } } -/************************************************************************* -|* -|* Konstruktor 1 -|* -\************************************************************************/ - E3dView::E3dView(SdrModel* pModel, OutputDevice* pOut) : SdrView(pModel, pOut) { InitView (); } -/************************************************************************* -|* -|* DrawMarkedObj ueberladen, da eventuell nur einzelne 3D-Objekte -|* gezeichnet werden sollen -|* -\************************************************************************/ +// DrawMarkedObj overloaded, since possibly only a single 3D object is to be +// drawn void E3dView::DrawMarkedObj(OutputDevice& rOut) const { - // Existieren 3D-Objekte, deren Szenen nicht selektiert sind? + // Does 3D objects exist which scenes are not selected? sal_Bool bSpecialHandling = sal_False; E3dScene *pScene = NULL; @@ -264,12 +254,12 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj && pObj->ISA(E3dCompoundObject)) { - // zugehoerige Szene + // related scene pScene = ((E3dCompoundObject*)pObj)->GetScene(); if(pScene && !IsObjMarked(pScene)) bSpecialHandling = sal_True; } - // Alle SelectionFlags zuruecksetzen + // Reset all selection flags if(pObj && pObj->ISA(E3dObject)) { pScene = ((E3dObject*)pObj)->GetScene(); @@ -280,15 +270,15 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const if(bSpecialHandling) { - // SelectionFlag bei allen zu 3D Objekten gehoerigen - // Szenen und deren Objekten auf nicht selektiert setzen + // Set selection flag to "not selected" for scenes related to all 3D + // objects long nObjs; for(nObjs = 0;nObjs < nCnt;nObjs++) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj && pObj->ISA(E3dCompoundObject)) { - // zugehoerige Szene + // relatated scene pScene = ((E3dCompoundObject*)pObj)->GetScene(); if(pScene) pScene->SetSelected(sal_False); @@ -300,7 +290,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj && pObj->ISA(E3dObject)) { - // Objekt markieren + // Select object E3dObject* p3DObj = (E3dObject*)pObj; p3DObj->SetSelected(sal_True); pScene = p3DObj->GetScene(); @@ -313,17 +303,17 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const SortMarkedObjects(); pScene->SetDrawOnlySelected(sal_True); - pScene->SingleObjectPainter(rOut); // #110094#-17 + pScene->SingleObjectPainter(rOut); pScene->SetDrawOnlySelected(sal_False); } - // SelectionFlag zuruecksetzen + // Reset selection flag for(nObjs = 0;nObjs < nCnt;nObjs++) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj && pObj->ISA(E3dCompoundObject)) { - // zugehoerige Szene + // releated scene pScene = ((E3dCompoundObject*)pObj)->GetScene(); if(pScene) pScene->SetSelected(sal_False); @@ -337,16 +327,12 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const } } -/************************************************************************* -|* -|* Model holen ueberladen, da bei einzelnen 3D Objekten noch eine Szene -|* untergeschoben werden muss -|* -\************************************************************************/ +// Get overloaded model, since in some 3D objects an additional scene +// must be pushed in SdrModel* E3dView::GetMarkedObjModel() const { - // Existieren 3D-Objekte, deren Szenen nicht selektiert sind? + // Does 3D objects exist which scenes are not selected? bool bSpecialHandling(false); const sal_uInt32 nCount(GetMarkedObjectCount()); sal_uInt32 nObjs(0); @@ -459,22 +445,17 @@ SdrModel* E3dView::GetMarkedObjModel() const // restore old selection rCurrentMarkList = aOldML; - // model zurueckgeben return pNewModel; } -/************************************************************************* -|* -|* Bei Paste muss - falls in eine Scene eingefuegt wird - die -|* Objekte der Szene eingefuegt werden, die Szene selbst aber nicht -|* -\************************************************************************/ +// When pasting objects have to integrated if a scene is inserted, but +// not the scene itself sal_Bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions) { sal_Bool bRetval = sal_False; - // Liste holen + // Get list Point aPos(rPos); SdrObjList* pDstList = pLst; ImpGetPasteObjList(aPos, pDstList); @@ -482,14 +463,14 @@ sal_Bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLs if(!pDstList) return sal_False; - // Owner der Liste holen + // Get owner of the list SdrObject* pOwner = pDstList->GetOwnerObj(); if(pOwner && pOwner->ISA(E3dScene)) { E3dScene* pDstScene = (E3dScene*)pOwner; BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_EXCHANGE_PASTE)); - // Alle Objekte aus E3dScenes kopieren und direkt einfuegen + // Copy all objects from E3dScenes and insert them directly for(sal_uInt16 nPg(0); nPg < rMod.GetPageCount(); nPg++) { const SdrPage* pSrcPg=rMod.GetPage(nPg); @@ -499,7 +480,7 @@ sal_Bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLs Rectangle aR = pSrcPg->GetAllObjBoundRect(); Point aDist(aPos - aR.Center()); - // Unterobjekte von Szenen einfuegen + // Insert sub-objects for scenes for(sal_uInt32 nOb(0); nOb < nObAnz; nOb++) { const SdrObject* pSrcOb = pSrcPg->GetObj(nOb); @@ -518,11 +499,10 @@ sal_Bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLs bRetval = SdrView::Paste(rMod, rPos, pLst, nOptions); } - // und Rueckgabewert liefern return bRetval; } -// #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...) +// Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...) sal_Bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene, Point /*aOffset*/) { sal_Bool bRetval(sal_False); @@ -540,7 +520,6 @@ sal_Bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* if(pCompoundObj) { - // #116235# E3dCompoundObject* pNewCompoundObj = dynamic_cast< E3dCompoundObject* >(pCompoundObj->Clone()); if(pNewCompoundObj) @@ -622,7 +601,7 @@ sal_Bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene->Insert3DObj(pNewCompoundObj); bRetval = sal_True; - // Undo anlegen + // Create undo if( GetModel()->IsUndoEnabled() ) AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pNewCompoundObj)); } @@ -633,12 +612,6 @@ sal_Bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* return bRetval; } -/************************************************************************* -|* -|* 3D-Konvertierung moeglich? -|* -\************************************************************************/ - sal_Bool E3dView::IsConvertTo3DObjPossible() const { sal_Bool bAny3D(sal_False); @@ -687,11 +660,6 @@ void E3dView::ImpIsConvertTo3DPossible(SdrObject* pObj, sal_Bool& rAny3D, } } -/************************************************************************* -|* -|* 3D-Konvertierung zu Extrude ausfuehren -|* -\************************************************************************/ #include <editeng/eeitem.hxx> void E3dView::ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj) @@ -702,10 +670,10 @@ void E3dView::ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj) const SvxColorItem& rTextColorItem = (const SvxColorItem&)rSet.Get(EE_CHAR_COLOR); if(rTextColorItem.GetValue() == RGB_Color(COL_BLACK)) { - // Bei schwarzen Textobjekten wird die Farbe auf grau gesetzt + //For black text objects, the color set to gray if(pObj->GetPage()) { - // #84864# if black is only default attribute from + // if black is only default attribute from // pattern set it hard so that it is used in undo. pObj->SetMergedItem(SvxColorItem(RGB_Color(COL_BLACK), EE_CHAR_COLOR)); @@ -743,7 +711,7 @@ void E3dView::ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj) void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, sal_Bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat) { - // Einzelnes PathObject, dieses umwanden + // Single PathObject, transform this SdrPathObj* pPath = PTR_CAST(SdrPathObj, pObj); if(pPath) @@ -754,35 +722,34 @@ void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, sal else aDefault.SetDefaultLatheCharacterMode(sal_True); - // ItemSet des Ursprungsobjektes holen + // Get Itemset of the original object SfxItemSet aSet(pObj->GetMergedItemSet()); XFillStyle eFillStyle = ITEMVALUE(aSet, XATTR_FILLSTYLE, XFillStyleItem); - // Linienstil ausschalten + // line style turned off aSet.Put(XLineStyleItem(XLINE_NONE)); - // Feststellen, ob ein FILL_Attribut gesetzt ist. + //Determining if FILL_Attribut is set. if(!pPath->IsClosed() || eFillStyle == XFILL_NONE) { - // Das SdrPathObj ist nicht gefuellt, lasse die - // vordere und hintere Flaeche weg. Ausserdem ist - // eine beidseitige Darstellung notwendig. + // This SdrPathObj is not filled, leave the front and rear face out. + // Moreover, a two-sided representation necessary. aDefault.SetDefaultExtrudeCloseFront(sal_False); aDefault.SetDefaultExtrudeCloseBack(sal_False); aSet.Put(Svx3DDoubleSidedItem(sal_True)); - // Fuellattribut setzen + // Set fill attribute aSet.Put(XFillStyleItem(XFILL_SOLID)); - // Fuellfarbe muss auf Linienfarbe, da das Objekt vorher - // nur eine Linie war + // Fill color must be the color line, because the object was + // previously just a line Color aColorLine = ((const XLineColorItem&)(aSet.Get(XATTR_LINECOLOR))).GetColorValue(); aSet.Put(XFillColorItem(String(), aColorLine)); } - // Neues Extrude-Objekt erzeugen + // Create a new extrude object E3dObject* p3DObj = NULL; if(bExtrude) { @@ -795,7 +762,7 @@ void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, sal p3DObj = new E3dLatheObj(aDefault, aPolyPoly2D); } - // Attribute setzen + // Set attribute if(p3DObj) { p3DObj->NbcSetLayer(pObj->GetLayer()); @@ -804,7 +771,7 @@ void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, sal p3DObj->NbcSetStyleSheet(pObj->GetStyleSheet(), sal_True); - // Neues 3D-Objekt einfuegen + // Insert a new extrude object pScene->Insert3DObj(p3DObj); } } @@ -863,45 +830,39 @@ void E3dView::ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, sal_Bool bExt else ImpCreateSingle3DObjectFlat(pScene, pNewObj2, bExtrude, fDepth, rLatheMat); - // delete zwi object + // delete object in between if(pNewObj2 != pObj && pNewObj2 != pNewObj1 && pNewObj2) SdrObject::Free( pNewObj2 ); } - // delete zwi object + // delete object in between if(pNewObj1 != pObj && pNewObj1) SdrObject::Free( pNewObj1 ); } } } -/************************************************************************* -|* -|* 3D-Konvertierung zu Extrude steuern -|* -\************************************************************************/ - void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, basegfx::B2DPoint aPnt2) { if(AreObjectsMarked()) { - // Undo anlegen + // Create undo if(bExtrude) BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_EXTRUDE)); else BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_LATHE)); - // Neue Szene fuer zu erzeugende 3D-Objekte anlegen + // Create a new scene for the created 3D object E3dScene* pScene = new E3dPolyScene(Get3DDefaultAttributes()); - // Rechteck bestimmen und evtl. korrigieren + // Determine rectangle and possibly correct it Rectangle aRect = GetAllMarkedRect(); if(aRect.GetWidth() <= 1) aRect.SetSize(Size(500, aRect.GetHeight())); if(aRect.GetHeight() <= 1) aRect.SetSize(Size(aRect.GetWidth(), 500)); - // Tiefe relativ zur Groesse der Selektion bestimmen + // Determine the depth relative to the size of the selection double fDepth = 0.0; double fRot3D = 0.0; basegfx::B2DHomMatrix aLatheMat; @@ -914,11 +875,11 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b } if(!bExtrude) { - // Transformation fuer Polygone Rotationskoerper erstellen + // Create transformation for the polygons rotating body if(aPnt1 != aPnt2) { - // Rotation um Kontrollpunkt1 mit eigestelltem Winkel - // fuer 3D Koordinaten + // Rotation around control point #1 with set angle + // for 3D coordinates basegfx::B2DPoint aDiff(aPnt1 - aPnt2); fRot3D = atan2(aDiff.getY(), aDiff.getX()) - F_PI2; @@ -934,7 +895,7 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b if(aPnt2.getX() != 0.0) { - // Translation auf Y=0 - Achse + // Translation to Y=0 - axis aLatheMat.translate(-aPnt2.getX(), 0.0); } else @@ -942,12 +903,11 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b aLatheMat.translate((double)-aRect.Left(), 0.0); } - // Inverse Matrix bilden, um die Zielausdehnung zu bestimmen + // Form the inverse matrix to determine the target expansion basegfx::B2DHomMatrix aInvLatheMat(aLatheMat); aInvLatheMat.invert(); - // SnapRect Ausdehnung mittels Spiegelung an der Rotationsachse - // erweitern + // SnapRect extension enables mirroring in the axis of rotation for(sal_uInt32 a=0;a<GetMarkedObjectCount();a++) { SdrMark* pMark = GetSdrMarkByIndex(a); @@ -986,8 +946,8 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b } } - // Ueber die Selektion gehen und in 3D wandeln, komplett mit - // Umwandeln in SdrPathObject, auch Schriften + // Walk throguh the selection and convert it into 3D, complete with + // Convertion to SdrPathObject, also fonts for(sal_uInt32 a=0;a<GetMarkedObjectCount();a++) { SdrMark* pMark = GetSdrMarkByIndex(a); @@ -998,24 +958,24 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b if(pScene->GetSubList() && pScene->GetSubList()->GetObjCount() != 0) { - // Alle angelegten Objekte Tiefenarrangieren + // Arrange all created objects by depth if(bExtrude) DoDepthArrange(pScene, fDepth); - // 3D-Objekte auf die Mitte des Gesamtrechtecks zentrieren + // Center 3D objects in the middle of the overall rectangle basegfx::B3DPoint aCenter(pScene->GetBoundVolume().getCenter()); basegfx::B3DHomMatrix aMatrix; aMatrix.translate(-aCenter.getX(), -aCenter.getY(), -aCenter.getZ()); - pScene->SetTransform(aMatrix * pScene->GetTransform()); // #112587# + pScene->SetTransform(aMatrix * pScene->GetTransform()); - // Szene initialisieren + // Initialize scene pScene->NbcSetSnapRect(aRect); basegfx::B3DRange aBoundVol = pScene->GetBoundVolume(); InitScene(pScene, (double)aRect.GetWidth(), (double)aRect.GetHeight(), aBoundVol.getDepth()); - // Szene anstelle des ersten selektierten Objektes einfuegen - // und alle alten Objekte weghauen + // Insert scene instead of the first selected object and throw away + // all the old objects SdrObject* pRepObj = GetMarkedObjectByIndex(0); SdrPageView* pPV = GetSdrPageViewOfMarkedByIndex(0); MarkObj(pRepObj, pPV, sal_True); @@ -1023,7 +983,7 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b DeleteMarked(); MarkObj(pScene, pPV); - // Rotationskoerper um Rotationsachse drehen + // Rotate Rotation body around the axis of rotation basegfx::B3DHomMatrix aRotate; if(!bExtrude && fRot3D != 0.0) @@ -1031,7 +991,7 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b aRotate.rotate(0.0, 0.0, fRot3D); } - // Default-Rotation setzen + // Set default rotation { double XRotateDefault = 20; aRotate.rotate(DEG2RAD(XRotateDefault), 0.0, 0.0); @@ -1042,25 +1002,20 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b pScene->SetTransform(aRotate * pScene->GetTransform()); } - // SnapRects der Objekte ungueltig + // Invalid SnapRects of objects pScene->SetSnapRect(aRect); } else { - // Es wurden keine 3D Objekte erzeugt, schmeiss alles weg + // No 3D object was created, throw away everything delete pScene; } - // Undo abschliessen EndUndo(); } } -/************************************************************************* -|* -|* Alle enthaltenen Extrude-Objekte Tiefenarrangieren -|* -\************************************************************************/ +//Arrange all created extrude objects by depth struct E3dDepthNeighbour { @@ -1237,11 +1192,7 @@ void E3dView::DoDepthArrange(E3dScene* pScene, double fDepth) } } -/************************************************************************* -|* -|* Drag beginnen, vorher ggf. Drag-Methode fuer 3D-Objekte erzeugen -|* -\************************************************************************/ +// Start drag, create for 3D objects before possibly drag method sal_Bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl, short nMinMov, @@ -1249,7 +1200,7 @@ sal_Bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut, { if(Is3DRotationCreationActive() && GetMarkedObjectCount()) { - // bestimme alle selektierten Polygone und gebe die gespiegelte Hilfsfigur aus + // Determine all selected polygons and return rhe mirrored helper overlay mpMirrorOverlay->SetMirrorAxis(aRef1, aRef2); } else @@ -1320,7 +1271,7 @@ sal_Bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut, default: break; } - // die nicht erlaubten Rotationen ausmaskieren + // do not mask the allowed rotations eConstraint = E3dDragConstraint(eConstraint& eDragConstraint); pForcedMeth = new E3dDragRotate(*this, GetMarkedObjectList(), eConstraint, IsSolidDragging()); } @@ -1335,7 +1286,7 @@ sal_Bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut, } break; - // spaeter mal + // later on case SDRDRAG_MIRROR: case SDRDRAG_CROOK: case SDRDRAG_DISTORT: @@ -1352,23 +1303,11 @@ sal_Bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut, return SdrView::BegDragObj(rPnt, pOut, pHdl, nMinMov, pForcedMeth); } -/************************************************************************* -|* -|* Pruefen, obj 3D-Szene markiert ist -|* -\************************************************************************/ - sal_Bool E3dView::HasMarkedScene() { return (GetMarkedScene() != NULL); } -/************************************************************************* -|* -|* Pruefen, obj 3D-Szene markiert ist -|* -\************************************************************************/ - E3dScene* E3dView::GetMarkedScene() { sal_uIntPtr nCnt = GetMarkedObjectCount(); @@ -1380,15 +1319,11 @@ E3dScene* E3dView::GetMarkedScene() return NULL; } -/************************************************************************* -|* -|* aktuelles 3D-Zeichenobjekt setzen, dafuer Szene erzeugen -|* -\************************************************************************/ +// Set current 3D drawing object, create the scene for this E3dScene* E3dView::SetCurrent3DObj(E3dObject* p3DObj) { - DBG_ASSERT(p3DObj != NULL, "Nana, wer steckt denn hier 'nen NULL-Zeiger rein?"); + DBG_ASSERT(p3DObj != NULL, "Who puts in a NULL-pointer here"); E3dScene* pScene = NULL; // get transformed BoundVolume of the object @@ -1409,12 +1344,6 @@ E3dScene* E3dView::SetCurrent3DObj(E3dObject* p3DObj) return pScene; } -/************************************************************************* -|* -|* neu erzeugte Szene initialisieren -|* -\************************************************************************/ - void E3dView::InitScene(E3dScene* pScene, double fW, double fH, double fCamZ) { Camera3D aCam(pScene->GetCamera()); @@ -1432,32 +1361,19 @@ void E3dView::InitScene(E3dScene* pScene, double fW, double fH, double fCamZ) pScene->SetCamera(aCam); } -/************************************************************************* -|* -|* startsequenz fuer die erstellung eines 3D-Rotationskoerpers -|* -\************************************************************************/ - void E3dView::Start3DCreation() { if (GetMarkedObjectCount()) { - // irgendwelche Markierungen ermitteln und ausschalten - //HMHBOOL bVis = IsMarkHdlShown(); - - //HMHif (bVis) HideMarkHdl(); - - // bestimme die koordinaten fuer JOEs Mirrorachse - // entgegen der normalen Achse wird diese an die linke Seite des Objektes - // positioniert + //positioned long nOutMin = 0; long nOutMax = 0; long nMinLen = 0; long nObjDst = 0; long nOutHgt = 0; - OutputDevice* pOut = GetFirstOutputDevice(); //GetWin(0); + OutputDevice* pOut = GetFirstOutputDevice(); - // erstmal Darstellungsgrenzen bestimmen + // first determine representation boundaries if (pOut != NULL) { nMinLen = pOut->PixelToLogic(Size(0,50)).Height(); @@ -1484,7 +1400,7 @@ void E3dView::Start3DCreation() if (nTemp > nMinLen) nMinLen = nTemp; } - // und dann die Markierungen oben und unten an das Objekt heften + // and then attach the marks at the top and bottom of the object basegfx::B2DRange aR; for(sal_uInt32 nMark(0L); nMark < GetMarkedObjectCount(); nMark++) { @@ -1517,32 +1433,25 @@ void E3dView::Start3DCreation() } } - aRef1.X() = basegfx::fround(aR.getMinX()); // Initial Achse um 2/100mm nach links + aRef1.X() = basegfx::fround(aR.getMinX()); // Initial move axis 2/100mm to the left aRef1.Y() = nY1; aRef2.X() = aRef1.X(); aRef2.Y() = nY2; - // Markierungen einschalten + // Turn on marks SetMarkHandles(); //HMHif (bVis) ShowMarkHdl(); if (AreObjectsMarked()) MarkListHasChanged(); - // SpiegelPolygone SOFORT zeigen + // Show mirror polygon IMMEDIATELY const SdrHdlList &aHdlList = GetHdlList(); mpMirrorOverlay = new Impl3DMirrorConstructOverlay(*this); mpMirrorOverlay->SetMirrorAxis(aHdlList.GetHdl(HDL_REF1)->GetPos(), aHdlList.GetHdl(HDL_REF2)->GetPos()); - //CreateMirrorPolygons (); - //ShowMirrorPolygons (aHdlList.GetHdl (HDL_REF1)->GetPos (), - // aHdlList.GetHdl (HDL_REF2)->GetPos ()); } } -/************************************************************************* -|* -|* was passiert bei einer Mausbewegung, wenn das Objekt erstellt wird ? -|* -\************************************************************************/ +// what happens with a mouse movement when the object is created? void E3dView::MovAction(const Point& rPnt) { @@ -1554,15 +1463,15 @@ void E3dView::MovAction(const Point& rPnt) { SdrHdlKind eHdlKind = pHdl->GetKind(); - // reagiere nur bei einer spiegelachse + // reacts only due to a mirror axis if ((eHdlKind == HDL_REF1) || (eHdlKind == HDL_REF2) || (eHdlKind == HDL_MIRX)) { const SdrHdlList &aHdlList = GetHdlList (); - // loesche das gespiegelte Polygon, spiegele das Original und zeichne es neu - //ShowMirrored (); + // delete the mirroed polygon, mirrors the original and draws + // it anew SdrView::MovAction (rPnt); mpMirrorOverlay->SetMirrorAxis( aHdlList.GetHdl (HDL_REF1)->GetPos(), @@ -1580,15 +1489,11 @@ void E3dView::MovAction(const Point& rPnt) } } -/************************************************************************* -|* -|* Schluss. Objekt und evtl. Unterobjekte ueber ImpCreate3DLathe erstellen -|* [FG] Mit dem Parameterwert sal_True (SDefault: sal_False) wird einfach ein -|* Rotationskoerper erzeugt, ohne den Benutzer die Lage der -|* Achse fetlegen zu lassen. Es reicht dieser Aufruf, falls -|* ein Objekt selektiert ist. (keine Initialisierung noetig) -|* -\************************************************************************/ +// The End. Create object and any child objects through ImpCreate3DLathe. +// With the parameter value sal_True (SDefault: sal_False) is simply a +// rotation body created, without letting the user set the position of the +// axis. It is sufficient with this call, if an object is selected. +// (No initialization necessary) void E3dView::End3DCreation(sal_Bool bUseDefaultValuesForMirrorAxes) { @@ -1611,8 +1516,9 @@ void E3dView::End3DCreation(sal_Bool bUseDefaultValuesForMirrorAxes) } else { - // Hilfsfigur ausschalten - // bestimme aus den Handlepositionen und den Versatz der Punkte + // Turn off helper overlay + // Determine from the handle positions and the displacement of + // the points const SdrHdlList &aHdlList = GetHdlList(); Point aMirrorRef1 = aHdlList.GetHdl(HDL_REF1)->GetPos(); Point aMirrorRef2 = aHdlList.GetHdl(HDL_REF2)->GetPos(); @@ -1625,22 +1531,10 @@ void E3dView::End3DCreation(sal_Bool bUseDefaultValuesForMirrorAxes) } } -/************************************************************************* -|* -|* Destruktor -|* -\************************************************************************/ - E3dView::~E3dView () { } -/************************************************************************* -|* -|* beende das erzeugen und loesche die polygone -|* -\************************************************************************/ - void E3dView::ResetCreationActive () { if(mpMirrorOverlay) @@ -1650,12 +1544,6 @@ void E3dView::ResetCreationActive () } } -/************************************************************************* -|* -|* Klasse initialisieren -|* -\************************************************************************/ - void E3dView::InitView () { eDragConstraint = E3DDRAG_CONSTR_XYZ; @@ -1676,12 +1564,6 @@ void E3dView::InitView () mpMirrorOverlay = 0L; } -/************************************************************************* -|* -|* Koennen die selektierten Objekte aufgebrochen werden? -|* -\************************************************************************/ - sal_Bool E3dView::IsBreak3DObjPossible() const { sal_uIntPtr nCount = GetMarkedObjectCount(); @@ -1715,17 +1597,11 @@ sal_Bool E3dView::IsBreak3DObjPossible() const return sal_True; } -/************************************************************************* -|* -|* Selektierte Lathe-Objekte aufbrechen -|* -\************************************************************************/ - void E3dView::Break3DObj() { if(IsBreak3DObjPossible()) { - // ALLE selektierten Objekte werden gewandelt + // ALL selected objects are changed sal_uInt32 nCount = GetMarkedObjectCount(); BegUndo(String(SVX_RESSTR(RID_SVX_3D_UNDO_BREAK_LATHE))); @@ -1764,12 +1640,6 @@ void E3dView::BreakSingle3DObj(E3dObject* pObj) } } -/************************************************************************* -|* -|* Szenen mischen -|* -\************************************************************************/ - void E3dView::MergeScenes () { sal_uIntPtr nCount = GetMarkedObjectCount(); @@ -1787,18 +1657,14 @@ void E3dView::MergeScenes () { if (pObj->ISA(E3dScene)) { - /********************************************************** - * Es ist eine 3D-Scene oder 3D-PolyScene - **********************************************************/ + // It is a 3D-Scene or 3D-PolyScene SdrObjList* pSubList = ((E3dObject*) pObj)->GetSubList(); SdrObjListIter aIter(*pSubList, IM_FLAT); while (aIter.IsMore()) { - /****************************************************** - * LatheObjekte suchen - ******************************************************/ + // Search for Lathe objects SdrObject* pSubObj = aIter.Next(); E3dObject *pNewObj = 0; @@ -1835,7 +1701,7 @@ void E3dView::MergeScenes () basegfx::B3DHomMatrix aMatrix; aMatrix.translate(aBoundRect.Left() - aCenter.getX(), aCenter.getY(), 0.0); - pNewObj->SetTransform(aMatrix * pNewObj->GetTransform()); // #112587# + pNewObj->SetTransform(aMatrix * pNewObj->GetTransform()); if (pNewObj) aBoundVol.expand(pNewObj->GetBoundVolume()); pScene->Insert3DObj (pNewObj); @@ -1872,27 +1738,22 @@ void E3dView::MergeScenes () aCamera.SetFocalLength(GetDefaultCamFocal()); pScene->SetCamera (aCamera); - // SnapRects der Objekte ungueltig + // Invalid SnapRects of Objects pScene->SetRectsDirty(); InsertObjectAtView(pScene, *(GetSdrPageViewOfMarkedByIndex(0))); - // SnapRects der Objekte ungueltig + // Invalid SnapRects of Objects pScene->SetRectsDirty(); } } -/************************************************************************* -|* -|* Possibilities, hauptsaechlich gruppieren/ungruppieren -|* -\************************************************************************/ void E3dView::CheckPossibilities() { // call parent SdrView::CheckPossibilities(); - // Weitere Flags bewerten + // Set other flags if(bGroupPossible || bUnGroupPossible || bGrpEnterPossible) { sal_Int32 nMarkCnt = GetMarkedObjectCount(); @@ -1907,9 +1768,8 @@ void E3dView::CheckPossibilities() b3DObject = sal_True; } - // Bisher: Es sind ZWEI oder mehr beliebiger Objekte selektiert. - // Nachsehen, ob CompoundObjects beteiligt sind. Falls ja, - // das Gruppieren verbieten. + // So far: there are two or more of any objects selected. See if + // compound objects are involved. If yes, ban grouping. if(bGroupPossible && bCoumpound) bGroupPossible = sal_False; diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx index fac79c1d2cb2..688c4a698684 100644 --- a/svx/source/engine3d/view3d1.cxx +++ b/svx/source/engine3d/view3d1.cxx @@ -53,12 +53,6 @@ #include <svx/svdogrp.hxx> #include <svx/e3dsceneupdater.hxx> -/************************************************************************* -|* -|* Konvertierung in Polygone -|* -\************************************************************************/ - void E3dView::ConvertMarkedToPolyObj(sal_Bool bLineToArea) { SdrObject* pNewObj = NULL; @@ -87,12 +81,6 @@ void E3dView::ConvertMarkedToPolyObj(sal_Bool bLineToArea) } } -/************************************************************************* -|* -|* Get3DAttributes -|* -\************************************************************************/ - void Imp_E3dView_InorderRun3DObjects(const SdrObject* pObj, sal_uInt32& rMask) { if(pObj->ISA(E3dLatheObj)) @@ -121,7 +109,7 @@ void Imp_E3dView_InorderRun3DObjects(const SdrObject* pObj, sal_uInt32& rMask) SfxItemSet E3dView::Get3DAttributes(E3dScene* pInScene, sal_Bool /*bOnly3DAttr*/) const { - // ItemSet mit entspr. Bereich anlegen + // Creating itemset with corresponding field SfxItemSet aSet( pMod->GetItemPool(), SDRATTR_START, SDRATTR_END, @@ -151,42 +139,35 @@ SfxItemSet E3dView::Get3DAttributes(E3dScene* pInScene, sal_Bool /*bOnly3DAttr*/ } } - // setze SID_ATTR_3D_INTERN auf den Status der selektierten Objekte + // Set SID_ATTR_3D_INTERN on the status of the selected objects aSet.Put(SfxUInt32Item(SID_ATTR_3D_INTERN, nSelectedItems)); - // DefaultValues pflegen + // maintain default values if(!nSelectedItems && !pInScene) { - // Defaults holen und hinzufuegen + // Get defaults and apply SfxItemSet aDefaultSet(pMod->GetItemPool(), SDRATTR_3D_FIRST, SDRATTR_3D_LAST); GetAttributes(aDefaultSet); aSet.Put(aDefaultSet); - // ... aber keine Linien fuer 3D + // ... but no lines for 3D aSet.Put(XLineStyleItem (XLINE_NONE)); - // #84061# new defaults for distance and focal length + // new defaults for distance and focal length aSet.Put(Svx3DDistanceItem(100)); aSet.Put(Svx3DFocalLengthItem(10000)); } - // ItemSet zurueckgeben + // return ItemSet return(aSet); } -/************************************************************************* -|* -|* Set3DAttributes: -|* -\************************************************************************/ - void E3dView::Set3DAttributes( const SfxItemSet& rAttr, E3dScene* pInScene, sal_Bool bReplaceAll) { sal_uInt32 nSelectedItems(0L); if(pInScene) { - //pInScene->SetItemSetAndBroadcast(rAttr, bReplaceAll); pInScene->SetMergedItemSetAndBroadcast(rAttr, bReplaceAll); } else @@ -208,10 +189,10 @@ void E3dView::Set3DAttributes( const SfxItemSet& rAttr, E3dScene* pInScene, sal_ } } - // DefaultValues pflegen + // Maintain default values if(!nSelectedItems && !pInScene) { - // Defaults setzen + // Set defaults SfxItemSet aDefaultSet(pMod->GetItemPool(), SDRATTR_3D_FIRST, SDRATTR_3D_LAST); aDefaultSet.Put(rAttr); SetAttributes(aDefaultSet); diff --git a/svx/source/engine3d/viewpt3d2.cxx b/svx/source/engine3d/viewpt3d2.cxx index b88126d45289..76dba241fe92 100644 --- a/svx/source/engine3d/viewpt3d2.cxx +++ b/svx/source/engine3d/viewpt3d2.cxx @@ -31,12 +31,6 @@ #include <svx/viewpt3d.hxx> #include <svx/volume3d.hxx> -/************************************************************************* -|* -|* Konstruktor -|* -\************************************************************************/ - Viewport3D::Viewport3D() : aVRP(0, 0, 5), aVPN(0, 0, 1), @@ -57,11 +51,7 @@ Viewport3D::Viewport3D() : aViewWin.W = 2; aViewWin.H = 2; } -/************************************************************************* -|* -|* ViewWindow (in View-Koordinaten) setzen -|* -\************************************************************************/ +// Set ViewWindow (in View coordinates) void Viewport3D::SetViewWindow(double fX, double fY, double fW, double fH) { @@ -76,12 +66,6 @@ void Viewport3D::SetViewWindow(double fX, double fY, double fW, double fH) fHRatio = aDeviceRect.GetHeight() / aViewWin.H; } -/************************************************************************* -|* -|* ViewWindow zurueckgeben -|* -\************************************************************************/ - void Viewport3D::GetViewWindow(double& rX, double& rY, double& rW, double& rH) const { @@ -91,11 +75,7 @@ void Viewport3D::GetViewWindow(double& rX, double& rY, rH = aViewWin.H; } -/************************************************************************* -|* -|* Beobachterposition (PRP) in Weltkoordinaten zurueckgeben -|* -\************************************************************************/ +// Returns observer position (PRP) in world coordinates const basegfx::B3DPoint& Viewport3D::GetViewPoint() { @@ -104,11 +84,7 @@ const basegfx::B3DPoint& Viewport3D::GetViewPoint() return aViewPoint; } -/************************************************************************* -|* -|* Transformationsmatrix zurueckgeben -|* -\************************************************************************/ +// Returns transformations matrix const basegfx::B3DHomMatrix& Viewport3D::GetViewTransform() { @@ -117,17 +93,7 @@ const basegfx::B3DHomMatrix& Viewport3D::GetViewTransform() return aViewTf; } - - - - - - -/************************************************************************* -|* -|* View-Transformationsmatrix berechnen -|* -\************************************************************************/ +// Calculate View transformations matrix void Viewport3D::MakeTransform(void) { @@ -136,13 +102,13 @@ void Viewport3D::MakeTransform(void) double fV, fXupVp, fYupVp; aViewPoint = aVRP + aVPN * aPRP.getZ(); - // auf Einheitsmatrix zuruecksetzen + // Reset to Identity matrix aViewTf.identity(); - // in den Ursprung verschieben + // shift in the origin aViewTf.translate(-aVRP.getX(), -aVRP.getY(), -aVRP.getZ()); - // fV = Laenge der Projektion von aVPN auf die yz-Ebene: + // fV = Length of the projection of aVPN on the yz plane: fV = aVPN.getYZLength(); if ( fV != 0 ) @@ -168,8 +134,8 @@ void Viewport3D::MakeTransform(void) aViewTf *= aTemp; } - // X- und Y-Koordinaten des View Up Vektors in das (vorlaeufige) - // View-Koordinatensytem umrechnen + // Convert X- and Y- coordinates of the view up vector to the + // (preliminary) view coordinate system. fXupVp = aViewTf.get(0, 0) * aVUV.getX() + aViewTf.get(0, 1) * aVUV.getY() + aViewTf.get(0, 2) * aVUV.getZ(); fYupVp = aViewTf.get(1, 0) * aVUV.getX() + aViewTf.get(1, 1) * aVUV.getY() + aViewTf.get(1, 2) * aVUV.getZ(); fV = sqrt(fXupVp * fXupVp + fYupVp * fYupVp); @@ -190,12 +156,6 @@ void Viewport3D::MakeTransform(void) } } -/************************************************************************* -|* -|* DeviceWindow des Ausgabegeraetes setzen -|* -\************************************************************************/ - void Viewport3D::SetDeviceWindow(const Rectangle& rRect) { long nNewW = rRect.GetWidth(); @@ -207,11 +167,11 @@ void Viewport3D::SetDeviceWindow(const Rectangle& rRect) { double fRatio, fTmp; - // Mapping, ohne die reale Groesse der Objekte im Device-Window - // zu aendern + // Mapping, without changing the real size of the objects in the + // Device Window case AS_HOLD_SIZE: - // Wenn Device ungueltig (w, h = -1), zunaechst - // View mit AsHoldX anpassen + // When the Device is invalid (w, h = -1), adapt the View + // with AsHoldX if ( nOldW > 0 && nOldH > 0 ) { fRatio = (double) nNewW / nOldW; @@ -223,7 +183,7 @@ void Viewport3D::SetDeviceWindow(const Rectangle& rRect) break; } case AS_HOLD_X: - // View-Hoehe an -Breite anpassen + // Adapt view height to view width fRatio = (double) nNewH / nNewW; fTmp = aViewWin.H; aViewWin.H = aViewWin.W * fRatio; @@ -231,7 +191,7 @@ void Viewport3D::SetDeviceWindow(const Rectangle& rRect) break; case AS_HOLD_Y: - // View-Breite an -Hoehe anpassen + // Adapt view width to view height fRatio = (double) nNewW / nNewH; fTmp = aViewWin.W; aViewWin.W = aViewWin.H * fRatio; @@ -245,20 +205,7 @@ void Viewport3D::SetDeviceWindow(const Rectangle& rRect) aDeviceRect = rRect; } - - - - - - - - - -/************************************************************************* -|* -|* 3D-Punkt auf Viewplane projizieren -|* -\************************************************************************/ +// Project the 3D pointon the View plane basegfx::B3DPoint Viewport3D::DoProjection(const basegfx::B3DPoint& rVec) const { @@ -275,8 +222,8 @@ basegfx::B3DPoint Viewport3D::DoProjection(const basegfx::B3DPoint& rVec) const } else { - // Das ist die Version fuer beliebigen PRP, wird aber - // aus Performancegruenden nicht verwendet + // This is the version for any PRP, but not used due to + // performance reasons fPrDist /= aVec.getZ() - aPRP.getZ(); aVec.setX(aVec.getX() * fPrDist); aVec.setY(aVec.getY() * fPrDist); @@ -286,18 +233,13 @@ basegfx::B3DPoint Viewport3D::DoProjection(const basegfx::B3DPoint& rVec) const return aVec; } -/************************************************************************* -|* -|* 3D-Punkt auf Geraetekoordinaten mappen -|* -\************************************************************************/ +// Mapp 3D point to device coordinates basegfx::B3DPoint Viewport3D::MapToDevice(const basegfx::B3DPoint& rVec) const { basegfx::B3DPoint aRetval; - // Y-Koordinate subtrahieren, da die Device-Y-Achse von oben - // nach unten verlaeuft + // Subtract Y-coordinate, since the device Y-Axis runs from top to bottom aRetval.setX((double)aDeviceRect.Left() + ((rVec.getX() - aViewWin.X) * fWRatio)); aRetval.setY((double)aDeviceRect.Bottom() - ((rVec.getY() - aViewWin.Y) * fHRatio)); aRetval.setZ(rVec.getZ()); @@ -305,11 +247,7 @@ basegfx::B3DPoint Viewport3D::MapToDevice(const basegfx::B3DPoint& rVec) const return aRetval; } -/************************************************************************* -|* -|* View Reference Point setzen -|* -\************************************************************************/ +// Set View Reference Point void Viewport3D::SetVRP(const basegfx::B3DPoint& rNewVRP) { @@ -317,11 +255,7 @@ void Viewport3D::SetVRP(const basegfx::B3DPoint& rNewVRP) bTfValid = sal_False; } -/************************************************************************* -|* -|* View Plane Normal setzen -|* -\************************************************************************/ +// Set View Plane Normal void Viewport3D::SetVPN(const basegfx::B3DVector& rNewVPN) { @@ -330,11 +264,7 @@ void Viewport3D::SetVPN(const basegfx::B3DVector& rNewVPN) bTfValid = sal_False; } -/************************************************************************* -|* -|* View Up Vector setzen -|* -\************************************************************************/ +// Set View Up Vector void Viewport3D::SetVUV(const basegfx::B3DVector& rNewVUV) { @@ -342,11 +272,7 @@ void Viewport3D::SetVUV(const basegfx::B3DVector& rNewVUV) bTfValid = sal_False; } -/************************************************************************* -|* -|* Center Of Projection setzen -|* -\************************************************************************/ +// Set Center Of Projection void Viewport3D::SetPRP(const basegfx::B3DPoint& rNewPRP) { @@ -356,11 +282,7 @@ void Viewport3D::SetPRP(const basegfx::B3DPoint& rNewPRP) bTfValid = sal_False; } -/************************************************************************* -|* -|* View Plane Distance setzen -|* -\************************************************************************/ +// Set View Plane Distance void Viewport3D::SetVPD(double fNewVPD) { @@ -368,11 +290,7 @@ void Viewport3D::SetVPD(double fNewVPD) bTfValid = sal_False; } -/************************************************************************* -|* -|* Abstand der vorderen Clippingebene setzen -|* -\************************************************************************/ +// Set distance of the front Clipping plane void Viewport3D::SetNearClipDist(double fNewNCD) { @@ -380,11 +298,7 @@ void Viewport3D::SetNearClipDist(double fNewNCD) bTfValid = sal_False; } -/************************************************************************* -|* -|* Abstand der hinteren Clippingebene setzen -|* -\************************************************************************/ +// Set distance of the rear Clipping plane void Viewport3D::SetFarClipDist(double fNewFCD) { |