diff options
author | Pascal Junck <pjunck@openoffice.org> | 2004-11-03 09:39:17 +0000 |
---|---|---|
committer | Pascal Junck <pjunck@openoffice.org> | 2004-11-03 09:39:17 +0000 |
commit | e3c8c249927d17f3cd4c4acac1f1982833facaa6 (patch) | |
tree | de0f349491a499139f24f5f11a6edeb4c5a03190 /svx/source/engine3d/lathe3d.cxx | |
parent | 4687749a2a503f8c35a532cb60c6f134011f336b (diff) |
INTEGRATION: CWS aw019 (1.17.208); FILE MERGED
2004/10/06 16:18:11 aw 1.17.208.2: #i34831#
2004/09/28 15:53:01 aw 1.17.208.1: #i11190#
Diffstat (limited to 'svx/source/engine3d/lathe3d.cxx')
-rw-r--r-- | svx/source/engine3d/lathe3d.cxx | 863 |
1 files changed, 431 insertions, 432 deletions
diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx index 00ee8e5ea551..33792771f215 100644 --- a/svx/source/engine3d/lathe3d.cxx +++ b/svx/source/engine3d/lathe3d.cxx @@ -2,9 +2,9 @@ * * $RCSfile: lathe3d.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: kz $ $Date: 2004-06-10 11:32:26 $ + * last change: $Author: pjunck $ $Date: 2004-11-03 10:39:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -271,13 +271,13 @@ void E3dLatheObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault) |* \************************************************************************/ -void E3dLatheObj::GetLineGeometry(PolyPolygon3D& rLinePolyPolygon) const +::basegfx::B3DPolyPolygon E3dLatheObj::Get3DLineGeometry() const { - // #78972# add extrude line polys - rLinePolyPolygon.Insert(maLinePolyPolygon); + ::basegfx::B3DPolyPolygon aRetval; - // don't call parent - //E3dCompoundObject::GetLineGeometry(rLinePolyPolygon); + aRetval.append(maLinePolyPolygon.getB3DPolyPolygon()); + + return aRetval; } /************************************************************************* @@ -555,21 +555,20 @@ UINT16 E3dLatheObj::GetObjIdentifier() const |* \************************************************************************/ -void E3dLatheObj::CreateWireframe(Polygon3D& rWirePoly, const Matrix4D* pTf, - E3dDragDetail eDetail) -{ - // Nur selbst erzeugen, wenn alle Linien angezeigt werden sollen - if ( eDetail == E3DDETAIL_ALLLINES || - (eDetail == E3DDETAIL_DEFAULT && GetDragDetail() == E3DDETAIL_ALLLINES) ) - { - // Detailliert erzeugen - } - else - { - // call parent - E3dObject::CreateWireframe(rWirePoly, pTf, eDetail); - } -} +//BFS01void E3dLatheObj::CreateWireframe(Polygon3D& rWirePoly, const Matrix4D* pTf, E3dDragDetail eDetail) +//BFS01{ +//BFS01 // Nur selbst erzeugen, wenn alle Linien angezeigt werden sollen +//BFS01 if ( eDetail == E3DDETAIL_ALLLINES || +//BFS01 (eDetail == E3DDETAIL_DEFAULT && GetDragDetail() == E3DDETAIL_ALLLINES) ) +//BFS01 { +//BFS01 // Detailliert erzeugen +//BFS01 } +//BFS01 else +//BFS01 { +//BFS01 // call parent +//BFS01 E3dObject::CreateWireframe(rWirePoly, pTf, eDetail); +//BFS01 } +//BFS01} /************************************************************************* |* @@ -606,127 +605,127 @@ void E3dLatheObj::operator=(const SdrObject& rObj) |* \************************************************************************/ -void E3dLatheObj::WriteData(SvStream& rOut) const -{ -#ifndef SVX_LIGHT - long nVersion = rOut.GetVersion(); // Build_Nr * 10 z.B. 3810 - if(nVersion < 3800) - { - // Alte Geometrie erzeugen, um die E3dPolyObj's zu haben - ((E3dCompoundObject*)this)->ReCreateGeometry(TRUE); - } - - // leider kann das E3dLatheObj nicht auf E3dObject abgestuetzt werden, - // da neue Member hinzugekommen sind und die Kompatibilitaet erhalten - // bleiben muss. - SdrAttrObj::WriteData(rOut); - - // Fuer Abwaertskompatibilitaet (Lesen neuer Daten mit altem Code) - SdrDownCompat aCompat(rOut, STREAM_WRITE); -#ifdef DBG_UTIL - aCompat.SetID("E3dLatheObj"); -#endif - - pSub->Save(rOut); - - // Parameter aus E3dObject speichern - rOut << aLocalBoundVol; - Old_Matrix3D aMat3D; - aMat3D = aTfMatrix; - rOut << aMat3D; - rOut << nLogicalGroup; - rOut << nObjTreeLevel; - rOut << nPartOfParent; - rOut << UINT16(eDragDetail); - - // neue Member - // Alte version schreibt Polygon3D raus, neue Version - // benutzt dafuer das erste Teilpolygon von PolyPolygon3D - // rOut << aPolyPoly3D; - rOut << aPolyPoly3D[0]; - - rOut << GetHorizontalSegments(); - - rOut << GetEndAngle(); - - rOut << ((E3dLatheObj*)this)->GetDoubleSided(); - rOut << fLatheScale; - - // Ab Version 364f (19.06.97) - - // #83965# internally the real number of segments (edges) is - // used, no longer the number of points - sal_Int32 nVSegs = GetVerticalSegments(); - if(!aPolyPoly3D[0].IsClosed()) - nVSegs += 1; - - rOut << nVSegs; - - // Ab Version 374 (15.12.97) - rOut << aPolyPoly3D; - - rOut << ((double)GetBackScale() / 100.0); - - rOut << ((double)GetPercentDiagonal() / 200.0); - - rOut << GetSmoothNormals(); // #107245# (BOOL)bLatheSmoothed; - rOut << GetSmoothLids(); // #107245# (BOOL)bLatheSmoothFrontBack; - rOut << GetCharacterMode(); // #107245# (BOOL)bLatheCharacterMode; - - // Ab Version 395 (8.6.98): Parameter aus dem Objekt - // E3dCompoundObject. Da irgendwann mal jemand die Ableitungs- - // hierarchie beim FileFormat unterbrochen hat, wurden diese Attribute - // bisher NOCH NIE gespeichert (Grrr). Diese Stelle muss nun natuerlich - // auch IMMER MITGEPFLEGT werden, wenn sich Parameter in - // E3dCompoundObject oder E3dObject aendern. - rOut << GetDoubleSided(); - - rOut << BOOL(bCreateNormals); - rOut << BOOL(bCreateTexture); - - sal_uInt16 nVal = GetNormalsKind(); - rOut << BOOL(nVal > 0); - rOut << BOOL(nVal > 1); - - nVal = GetTextureProjectionX(); - rOut << BOOL(nVal > 0); - rOut << BOOL(nVal > 1); - - nVal = GetTextureProjectionY(); - rOut << BOOL(nVal > 0); - rOut << BOOL(nVal > 1); - - rOut << BOOL(GetShadow3D()); - - rOut << GetMaterialAmbientColor(); - rOut << GetMaterialColor(); - rOut << GetMaterialSpecular(); - rOut << GetMaterialEmission(); - rOut << GetMaterialSpecularIntensity(); - - aBackMaterial.WriteData(rOut); - - rOut << (UINT16)GetTextureKind(); - - rOut << (UINT16)GetTextureMode(); - - rOut << BOOL(GetNormalsInvert()); - - // Ab Version 513a (5.2.99): Parameter fuer das - // Erzeugen der Vorder/Rueckwand - rOut << GetCloseFront(); // #107245# BOOL(bLatheCloseFront); - rOut << GetCloseBack(); // #107245# BOOL(bLatheCloseBack); - - // neu ab 534: (hat noch gefehlt) - rOut << BOOL(GetTextureFilter()); - - if(nVersion < 3800) - { - // Geometrie neu erzeugen, um E3dPolyObj's wieder loszuwerden - ((E3dCompoundObject*)this)->ReCreateGeometry(); - } -#endif -} +//BFS01void E3dLatheObj::WriteData(SvStream& rOut) const +//BFS01{ +//BFS01#ifndef SVX_LIGHT +//BFS01 long nVersion = rOut.GetVersion(); // Build_Nr * 10 z.B. 3810 +//BFS01 if(nVersion < 3800) +//BFS01 { +//BFS01 // Alte Geometrie erzeugen, um die E3dPolyObj's zu haben +//BFS01 ((E3dCompoundObject*)this)->ReCreateGeometry(TRUE); +//BFS01 } +//BFS01 +//BFS01 // leider kann das E3dLatheObj nicht auf E3dObject abgestuetzt werden, +//BFS01 // da neue Member hinzugekommen sind und die Kompatibilitaet erhalten +//BFS01 // bleiben muss. +//BFS01 SdrAttrObj::WriteData(rOut); +//BFS01 +//BFS01 // Fuer Abwaertskompatibilitaet (Lesen neuer Daten mit altem Code) +//BFS01 SdrDownCompat aCompat(rOut, STREAM_WRITE); +//BFS01#ifdef DBG_UTIL +//BFS01 aCompat.SetID("E3dLatheObj"); +//BFS01#endif +//BFS01 +//BFS01 pSub->Save(rOut); +//BFS01 +//BFS01 // Parameter aus E3dObject speichern +//BFS01 rOut << aLocalBoundVol; +//BFS01 Old_Matrix3D aMat3D; +//BFS01 aMat3D = aTfMatrix; +//BFS01 rOut << aMat3D; +//BFS01 rOut << nLogicalGroup; +//BFS01 rOut << nObjTreeLevel; +//BFS01 rOut << nPartOfParent; +//BFS01 rOut << UINT16(eDragDetail); +//BFS01 +//BFS01 // neue Member +//BFS01 // Alte version schreibt Polygon3D raus, neue Version +//BFS01 // benutzt dafuer das erste Teilpolygon von PolyPolygon3D +//BFS01 // rOut << aPolyPoly3D; +//BFS01 rOut << aPolyPoly3D[0]; +//BFS01 +//BFS01 rOut << GetHorizontalSegments(); +//BFS01 +//BFS01 rOut << GetEndAngle(); +//BFS01 +//BFS01 rOut << ((E3dLatheObj*)this)->GetDoubleSided(); +//BFS01 rOut << fLatheScale; +//BFS01 +//BFS01 // Ab Version 364f (19.06.97) +//BFS01 +//BFS01 // #83965# internally the real number of segments (edges) is +//BFS01 // used, no longer the number of points +//BFS01 sal_Int32 nVSegs = GetVerticalSegments(); +//BFS01 if(!aPolyPoly3D[0].IsClosed()) +//BFS01 nVSegs += 1; +//BFS01 +//BFS01 rOut << nVSegs; +//BFS01 +//BFS01 // Ab Version 374 (15.12.97) +//BFS01 rOut << aPolyPoly3D; +//BFS01 +//BFS01 rOut << ((double)GetBackScale() / 100.0); +//BFS01 +//BFS01 rOut << ((double)GetPercentDiagonal() / 200.0); +//BFS01 +//BFS01 rOut << GetSmoothNormals(); // #107245# (BOOL)bLatheSmoothed; +//BFS01 rOut << GetSmoothLids(); // #107245# (BOOL)bLatheSmoothFrontBack; +//BFS01 rOut << GetCharacterMode(); // #107245# (BOOL)bLatheCharacterMode; +//BFS01 +//BFS01 // Ab Version 395 (8.6.98): Parameter aus dem Objekt +//BFS01 // E3dCompoundObject. Da irgendwann mal jemand die Ableitungs- +//BFS01 // hierarchie beim FileFormat unterbrochen hat, wurden diese Attribute +//BFS01 // bisher NOCH NIE gespeichert (Grrr). Diese Stelle muss nun natuerlich +//BFS01 // auch IMMER MITGEPFLEGT werden, wenn sich Parameter in +//BFS01 // E3dCompoundObject oder E3dObject aendern. +//BFS01 rOut << GetDoubleSided(); +//BFS01 +//BFS01 rOut << BOOL(bCreateNormals); +//BFS01 rOut << BOOL(bCreateTexture); +//BFS01 +//BFS01 sal_uInt16 nVal = GetNormalsKind(); +//BFS01 rOut << BOOL(nVal > 0); +//BFS01 rOut << BOOL(nVal > 1); +//BFS01 +//BFS01 nVal = GetTextureProjectionX(); +//BFS01 rOut << BOOL(nVal > 0); +//BFS01 rOut << BOOL(nVal > 1); +//BFS01 +//BFS01 nVal = GetTextureProjectionY(); +//BFS01 rOut << BOOL(nVal > 0); +//BFS01 rOut << BOOL(nVal > 1); +//BFS01 +//BFS01 rOut << BOOL(GetShadow3D()); +//BFS01 +//BFS01 rOut << GetMaterialAmbientColor(); +//BFS01 rOut << GetMaterialColor(); +//BFS01 rOut << GetMaterialSpecular(); +//BFS01 rOut << GetMaterialEmission(); +//BFS01 rOut << GetMaterialSpecularIntensity(); +//BFS01 +//BFS01 aBackMaterial.WriteData(rOut); +//BFS01 +//BFS01 rOut << (UINT16)GetTextureKind(); +//BFS01 +//BFS01 rOut << (UINT16)GetTextureMode(); +//BFS01 +//BFS01 rOut << BOOL(GetNormalsInvert()); +//BFS01 +//BFS01 // Ab Version 513a (5.2.99): Parameter fuer das +//BFS01 // Erzeugen der Vorder/Rueckwand +//BFS01 rOut << GetCloseFront(); // #107245# BOOL(bLatheCloseFront); +//BFS01 rOut << GetCloseBack(); // #107245# BOOL(bLatheCloseBack); +//BFS01 +//BFS01 // neu ab 534: (hat noch gefehlt) +//BFS01 rOut << BOOL(GetTextureFilter()); +//BFS01 +//BFS01 if(nVersion < 3800) +//BFS01 { +//BFS01 // Geometrie neu erzeugen, um E3dPolyObj's wieder loszuwerden +//BFS01 ((E3dCompoundObject*)this)->ReCreateGeometry(); +//BFS01 } +//BFS01#endif +//BFS01} /************************************************************************* |* @@ -734,294 +733,294 @@ void E3dLatheObj::WriteData(SvStream& rOut) const |* \************************************************************************/ -void E3dLatheObj::ReadData(const SdrObjIOHeader& rHead, SvStream& rIn) -{ - if (ImpCheckSubRecords (rHead, rIn)) - { - // leider kann das E3dLatheObj nicht auf E3dObject abgestuetzt werden, - // da neue Member hinzugekommen sind und die Kompatibilitaet erhalten - // bleiben muss. - SdrAttrObj::ReadData(rHead, rIn); - - // Fuer Abwaertskompatibilitaet (Lesen neuer Daten mit altem Code) - SdrDownCompat aCompat(rIn, STREAM_READ); -#ifdef DBG_UTIL - aCompat.SetID("E3dLatheObj"); -#endif - // dann die Member - UINT16 nTmp16; - - // #106240# Flag if poly was loaded (all versions above 3.0 and 3.1) - sal_Bool bPolyWasRead(sal_False); - - pSub->Load(rIn, *pPage); - - // Parameter aus E3dObject laden - rIn >> aLocalBoundVol; - Old_Matrix3D aMat3D; - rIn >> aMat3D; - aTfMatrix = Matrix4D(aMat3D); - rIn >> nLogicalGroup; - rIn >> nObjTreeLevel; - rIn >> nPartOfParent; - rIn >> nTmp16; eDragDetail = E3dDragDetail(nTmp16); - - // BoundVolume muss neu berechnet werden - bBoundVolValid = FALSE; - - if (aCompat.GetBytesLeft ()) - { - // neue Member - BOOL bTmp; - sal_Int32 nTmp; - - // alte Version holt sich nur ein Polygon3D, wird hier durch - // Eintragen als erstes Teilpolygon geladen - // rIn >> aPolyPoly3D; - rIn >> aPolyPoly3D[0]; - - // #106240# OK, this file does have a saved polygon - bPolyWasRead = sal_True; - - rIn >> nTmp; - GetProperties().SetObjectItemDirect(Svx3DHorizontalSegmentsItem(nTmp)); - - rIn >> nTmp; - GetProperties().SetObjectItemDirect(Svx3DEndAngleItem(nTmp)); - - rIn >> bTmp; - GetProperties().SetObjectItemDirect(Svx3DDoubleSidedItem(bTmp)); - - rIn >> fLatheScale; - } - - // #106240# No PolyPolygon as base for the lathe object was saved. - // Reconstruct it from the objects in the SubList. - if(!bPolyWasRead) - { - // This is really a old 3.0 or 3.1 file, reconstruct - // the not saved polygon using the SubList. - SdrObjList* pSubList = GetSubList(); - - if(pSubList && pSubList->GetObjCount()) - { - sal_uInt16 nHorSegCount = (sal_uInt16)GetHorizontalSegments() / 2; - sal_uInt16 nVerSegCount = (sal_uInt16)(pSubList->GetObjCount() / nHorSegCount); - Polygon3D aNewBasePoly; - - for(sal_uInt16 a(0); a < nVerSegCount; a++) - { - E3dPolyObj* pCandidate = (E3dPolyObj*)pSubList->GetObj(a * nHorSegCount); - if(pCandidate->ISA(E3dPolyObj)) - { - const PolyPolygon3D& rCandPoly = ((E3dPolyObj*)pCandidate)->GetPolyPolygon3D(); - - if(rCandPoly[0].GetPointCount() > 1) - { - aNewBasePoly[a] = rCandPoly[0][1]; - } - } - } - - aPolyPoly3D.Clear(); - aNewBasePoly.SetClosed(sal_True); - aPolyPoly3D.Insert(aNewBasePoly); - } - } - - if (aCompat.GetBytesLeft()) - { - // Ab Version 364f (19.06.97) - sal_Int32 nTmp; - rIn >> nTmp; - - // #83965# internally the real number of segments (edges) is - // used, no longer the number of points - if(!aPolyPoly3D[0].IsClosed()) - nTmp -= 1; - - GetProperties().SetObjectItemDirect(Svx3DVerticalSegmentsItem(nTmp)); - } - - if (aCompat.GetBytesLeft()) - { - // Ab Version 374 (15.12.97) - // Gesamtes PolyPolygon laden - BOOL bTmp; - double fTmp; - - aPolyPoly3D.Clear(); - rIn >> aPolyPoly3D; - - rIn >> fTmp; - GetProperties().SetObjectItemDirect(Svx3DBackscaleItem((sal_uInt16)(fTmp * 100.0))); - - rIn >> fTmp; - GetProperties().SetObjectItemDirect(Svx3DPercentDiagonalItem(sal_uInt16(fTmp * 200.0))); - - rIn >> bTmp; // #107245# bLatheSmoothed = bTmp; - GetProperties().SetObjectItemDirect(Svx3DSmoothNormalsItem(bTmp)); - - rIn >> bTmp; // #107245# bLatheSmoothFrontBack = bTmp; - GetProperties().SetObjectItemDirect(Svx3DSmoothLidsItem(bTmp)); - - rIn >> bTmp; // #107245# bLatheCharacterMode = bTmp; - GetProperties().SetObjectItemDirect(Svx3DCharacterModeItem(bTmp)); - } - else - { - // Geometrie aus erzeugten PolyObj's rekonstruieren - GetProperties().SetObjectItemDirect(Svx3DBackscaleItem(100)); - GetProperties().SetObjectItemDirect(Svx3DPercentDiagonalItem(10)); - - // #107245# bLatheSmoothed = TRUE; - GetProperties().SetObjectItemDirect(Svx3DSmoothNormalsItem(sal_True)); - - // #107245# bLatheSmoothFrontBack = FALSE; - GetProperties().SetObjectItemDirect(Svx3DSmoothLidsItem(sal_False)); - - // #107245# bLatheCharacterMode = FALSE; - GetProperties().SetObjectItemDirect(Svx3DCharacterModeItem(sal_False)); - } - - if (aCompat.GetBytesLeft()) - { - // Ab Version 395 (8.6.98): Parameter aus dem Objekt - // E3dCompoundObject. Da irgendwann mal jemand die Ableitungs- - // hierarchie beim FileFormat unterbrochen hat, wurden diese Attribute - // bisher NOCH NIE gespeichert (Grrr). Diese Stelle muss nun natuerlich - // auch IMMER MITGEPFLEGT werden, wenn sich Parameter in - // E3dCompoundObject oder E3dObject aendern. - BOOL bTmp, bTmp2; - sal_uInt16 nTmp; - - rIn >> bTmp; - GetProperties().SetObjectItemDirect(Svx3DDoubleSidedItem(bTmp)); - - rIn >> bTmp; bCreateNormals = bTmp; - rIn >> bTmp; bCreateTexture = bTmp; - - rIn >> bTmp; - rIn >> bTmp2; - if(bTmp == FALSE && bTmp2 == FALSE) - nTmp = 0; - else if(bTmp == TRUE && bTmp2 == FALSE) - nTmp = 1; - else - nTmp = 2; - GetProperties().SetObjectItemDirect(Svx3DNormalsKindItem(nTmp)); - - rIn >> bTmp; - rIn >> bTmp2; - if(bTmp == FALSE && bTmp2 == FALSE) - nTmp = 0; - else if(bTmp == TRUE && bTmp2 == FALSE) - nTmp = 1; - else - nTmp = 2; - GetProperties().SetObjectItemDirect(Svx3DTextureProjectionXItem(nTmp)); - - rIn >> bTmp; - rIn >> bTmp2; - if(bTmp == FALSE && bTmp2 == FALSE) - nTmp = 0; - else if(bTmp == TRUE && bTmp2 == FALSE) - nTmp = 1; - else - nTmp = 2; - GetProperties().SetObjectItemDirect(Svx3DTextureProjectionYItem(nTmp)); - - rIn >> bTmp; - GetProperties().SetObjectItemDirect(Svx3DShadow3DItem(bTmp)); - - Color aCol; - - rIn >> aCol; - SetMaterialAmbientColor(aCol); - - rIn >> aCol; - // do NOT use, this is the old 3D-Color(!) - // SetItem(XFillColorItem(String(), aCol)); - - rIn >> aCol; - GetProperties().SetObjectItemDirect(Svx3DMaterialSpecularItem(aCol)); - - rIn >> aCol; - GetProperties().SetObjectItemDirect(Svx3DMaterialEmissionItem(aCol)); - - rIn >> nTmp; - GetProperties().SetObjectItemDirect(Svx3DMaterialSpecularIntensityItem(nTmp)); - - aBackMaterial.ReadData(rIn); - - rIn >> nTmp; - GetProperties().SetObjectItemDirect(Svx3DTextureKindItem(nTmp)); - - rIn >> nTmp; - GetProperties().SetObjectItemDirect(Svx3DTextureModeItem(nTmp)); - - rIn >> bTmp; - GetProperties().SetObjectItemDirect(Svx3DNormalsInvertItem(bTmp)); - } - - if (aCompat.GetBytesLeft()) - { - // Ab Version 513a (5.2.99): Parameter fuer das - // Erzeugen der Vorder/Rueckwand - BOOL bTmp; - - rIn >> bTmp; // #107245# bLatheCloseFront = bTmp; - GetProperties().SetObjectItemDirect(Svx3DCloseFrontItem(bTmp)); - - rIn >> bTmp; // #107245# bLatheCloseBack = bTmp; - GetProperties().SetObjectItemDirect(Svx3DCloseBackItem(bTmp)); - } - else - { - // #107245# bLatheCloseFront = TRUE; - GetProperties().SetObjectItemDirect(Svx3DCloseFrontItem(sal_True)); - - // #107245# bLatheCloseBack = TRUE; - GetProperties().SetObjectItemDirect(Svx3DCloseBackItem(sal_True)); - } - - // neu ab 534: (hat noch gefehlt) - if (aCompat.GetBytesLeft () >= sizeof (BOOL)) - { - BOOL bTmp; - rIn >> bTmp; - GetProperties().SetObjectItemDirect(Svx3DTextureFilterItem(bTmp)); - } - } - - // correct position of extrude polygon, in case it's not positioned - // at the Z==0 layer - if(aPolyPoly3D.Count() && aPolyPoly3D[0].GetPointCount()) - { - const Vector3D& rFirstPoint = aPolyPoly3D[0][0]; - if(rFirstPoint.Z() != 0.0) - { - // change transformation so that source poly lies in Z == 0, - // so it can be exported as 2D polygon - // - // ATTENTION: the translation has to be multiplied from LEFT - // SIDE since it was executed as the first translate for this - // 3D object during it's creation. - double fTransDepth(rFirstPoint.Z()); - Matrix4D aTransMat; - aTransMat.TranslateZ(fTransDepth); - NbcSetTransform(GetTransform() * aTransMat); // #112587# - - // correct polygon itself - aTransMat.Identity(); - aTransMat.TranslateZ(-fTransDepth); - aPolyPoly3D.Transform(aTransMat); - } - } - - // Geometrie neu erzeugen - ReCreateGeometry(); -} +//BFS01void E3dLatheObj::ReadData(const SdrObjIOHeader& rHead, SvStream& rIn) +//BFS01{ +//BFS01 if (ImpCheckSubRecords (rHead, rIn)) +//BFS01 { +//BFS01 // leider kann das E3dLatheObj nicht auf E3dObject abgestuetzt werden, +//BFS01 // da neue Member hinzugekommen sind und die Kompatibilitaet erhalten +//BFS01 // bleiben muss. +//BFS01 SdrAttrObj::ReadData(rHead, rIn); +//BFS01 +//BFS01 // Fuer Abwaertskompatibilitaet (Lesen neuer Daten mit altem Code) +//BFS01 SdrDownCompat aCompat(rIn, STREAM_READ); +//BFS01#ifdef DBG_UTIL +//BFS01 aCompat.SetID("E3dLatheObj"); +//BFS01#endif +//BFS01 // dann die Member +//BFS01 UINT16 nTmp16; +//BFS01 +//BFS01 // #106240# Flag if poly was loaded (all versions above 3.0 and 3.1) +//BFS01 sal_Bool bPolyWasRead(sal_False); +//BFS01 +//BFS01 pSub->Load(rIn, *pPage); +//BFS01 +//BFS01 // Parameter aus E3dObject laden +//BFS01 rIn >> aLocalBoundVol; +//BFS01 Old_Matrix3D aMat3D; +//BFS01 rIn >> aMat3D; +//BFS01 aTfMatrix = Matrix4D(aMat3D); +//BFS01 rIn >> nLogicalGroup; +//BFS01 rIn >> nObjTreeLevel; +//BFS01 rIn >> nPartOfParent; +//BFS01 rIn >> nTmp16; eDragDetail = E3dDragDetail(nTmp16); +//BFS01 +//BFS01 // BoundVolume muss neu berechnet werden +//BFS01 bBoundVolValid = FALSE; +//BFS01 +//BFS01 if (aCompat.GetBytesLeft ()) +//BFS01 { +//BFS01 // neue Member +//BFS01 BOOL bTmp; +//BFS01 sal_Int32 nTmp; +//BFS01 +//BFS01 // alte Version holt sich nur ein Polygon3D, wird hier durch +//BFS01 // Eintragen als erstes Teilpolygon geladen +//BFS01 // rIn >> aPolyPoly3D; +//BFS01 rIn >> aPolyPoly3D[0]; +//BFS01 +//BFS01 // #106240# OK, this file does have a saved polygon +//BFS01 bPolyWasRead = sal_True; +//BFS01 +//BFS01 rIn >> nTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DHorizontalSegmentsItem(nTmp)); +//BFS01 +//BFS01 rIn >> nTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DEndAngleItem(nTmp)); +//BFS01 +//BFS01 rIn >> bTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DDoubleSidedItem(bTmp)); +//BFS01 +//BFS01 rIn >> fLatheScale; +//BFS01 } +//BFS01 +//BFS01 // #106240# No PolyPolygon as base for the lathe object was saved. +//BFS01 // Reconstruct it from the objects in the SubList. +//BFS01 if(!bPolyWasRead) +//BFS01 { +//BFS01 // This is really a old 3.0 or 3.1 file, reconstruct +//BFS01 // the not saved polygon using the SubList. +//BFS01 SdrObjList* pSubList = GetSubList(); +//BFS01 +//BFS01 if(pSubList && pSubList->GetObjCount()) +//BFS01 { +//BFS01 sal_uInt16 nHorSegCount = (sal_uInt16)GetHorizontalSegments() / 2; +//BFS01 sal_uInt16 nVerSegCount = (sal_uInt16)(pSubList->GetObjCount() / nHorSegCount); +//BFS01 Polygon3D aNewBasePoly; +//BFS01 +//BFS01 for(sal_uInt16 a(0); a < nVerSegCount; a++) +//BFS01 { +//BFS01 E3dPolyObj* pCandidate = (E3dPolyObj*)pSubList->GetObj(a * nHorSegCount); +//BFS01 if(pCandidate->ISA(E3dPolyObj)) +//BFS01 { +//BFS01 const PolyPolygon3D& rCandPoly = ((E3dPolyObj*)pCandidate)->GetPolyPolygon3D(); +//BFS01 +//BFS01 if(rCandPoly[0].GetPointCount() > 1) +//BFS01 { +//BFS01 aNewBasePoly[a] = rCandPoly[0][1]; +//BFS01 } +//BFS01 } +//BFS01 } +//BFS01 +//BFS01 aPolyPoly3D.Clear(); +//BFS01 aNewBasePoly.SetClosed(sal_True); +//BFS01 aPolyPoly3D.Insert(aNewBasePoly); +//BFS01 } +//BFS01 } +//BFS01 +//BFS01 if (aCompat.GetBytesLeft()) +//BFS01 { +//BFS01 // Ab Version 364f (19.06.97) +//BFS01 sal_Int32 nTmp; +//BFS01 rIn >> nTmp; +//BFS01 +//BFS01 // #83965# internally the real number of segments (edges) is +//BFS01 // used, no longer the number of points +//BFS01 if(!aPolyPoly3D[0].IsClosed()) +//BFS01 nTmp -= 1; +//BFS01 +//BFS01 GetProperties().SetObjectItemDirect(Svx3DVerticalSegmentsItem(nTmp)); +//BFS01 } +//BFS01 +//BFS01 if (aCompat.GetBytesLeft()) +//BFS01 { +//BFS01 // Ab Version 374 (15.12.97) +//BFS01 // Gesamtes PolyPolygon laden +//BFS01 BOOL bTmp; +//BFS01 double fTmp; +//BFS01 +//BFS01 aPolyPoly3D.Clear(); +//BFS01 rIn >> aPolyPoly3D; +//BFS01 +//BFS01 rIn >> fTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DBackscaleItem((sal_uInt16)(fTmp * 100.0))); +//BFS01 +//BFS01 rIn >> fTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DPercentDiagonalItem(sal_uInt16(fTmp * 200.0))); +//BFS01 +//BFS01 rIn >> bTmp; // #107245# bLatheSmoothed = bTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DSmoothNormalsItem(bTmp)); +//BFS01 +//BFS01 rIn >> bTmp; // #107245# bLatheSmoothFrontBack = bTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DSmoothLidsItem(bTmp)); +//BFS01 +//BFS01 rIn >> bTmp; // #107245# bLatheCharacterMode = bTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DCharacterModeItem(bTmp)); +//BFS01 } +//BFS01 else +//BFS01 { +//BFS01 // Geometrie aus erzeugten PolyObj's rekonstruieren +//BFS01 GetProperties().SetObjectItemDirect(Svx3DBackscaleItem(100)); +//BFS01 GetProperties().SetObjectItemDirect(Svx3DPercentDiagonalItem(10)); +//BFS01 +//BFS01 // #107245# bLatheSmoothed = TRUE; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DSmoothNormalsItem(sal_True)); +//BFS01 +//BFS01 // #107245# bLatheSmoothFrontBack = FALSE; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DSmoothLidsItem(sal_False)); +//BFS01 +//BFS01 // #107245# bLatheCharacterMode = FALSE; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DCharacterModeItem(sal_False)); +//BFS01 } +//BFS01 +//BFS01 if (aCompat.GetBytesLeft()) +//BFS01 { +//BFS01 // Ab Version 395 (8.6.98): Parameter aus dem Objekt +//BFS01 // E3dCompoundObject. Da irgendwann mal jemand die Ableitungs- +//BFS01 // hierarchie beim FileFormat unterbrochen hat, wurden diese Attribute +//BFS01 // bisher NOCH NIE gespeichert (Grrr). Diese Stelle muss nun natuerlich +//BFS01 // auch IMMER MITGEPFLEGT werden, wenn sich Parameter in +//BFS01 // E3dCompoundObject oder E3dObject aendern. +//BFS01 BOOL bTmp, bTmp2; +//BFS01 sal_uInt16 nTmp; +//BFS01 +//BFS01 rIn >> bTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DDoubleSidedItem(bTmp)); +//BFS01 +//BFS01 rIn >> bTmp; bCreateNormals = bTmp; +//BFS01 rIn >> bTmp; bCreateTexture = bTmp; +//BFS01 +//BFS01 rIn >> bTmp; +//BFS01 rIn >> bTmp2; +//BFS01 if(bTmp == FALSE && bTmp2 == FALSE) +//BFS01 nTmp = 0; +//BFS01 else if(bTmp == TRUE && bTmp2 == FALSE) +//BFS01 nTmp = 1; +//BFS01 else +//BFS01 nTmp = 2; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DNormalsKindItem(nTmp)); +//BFS01 +//BFS01 rIn >> bTmp; +//BFS01 rIn >> bTmp2; +//BFS01 if(bTmp == FALSE && bTmp2 == FALSE) +//BFS01 nTmp = 0; +//BFS01 else if(bTmp == TRUE && bTmp2 == FALSE) +//BFS01 nTmp = 1; +//BFS01 else +//BFS01 nTmp = 2; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DTextureProjectionXItem(nTmp)); +//BFS01 +//BFS01 rIn >> bTmp; +//BFS01 rIn >> bTmp2; +//BFS01 if(bTmp == FALSE && bTmp2 == FALSE) +//BFS01 nTmp = 0; +//BFS01 else if(bTmp == TRUE && bTmp2 == FALSE) +//BFS01 nTmp = 1; +//BFS01 else +//BFS01 nTmp = 2; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DTextureProjectionYItem(nTmp)); +//BFS01 +//BFS01 rIn >> bTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DShadow3DItem(bTmp)); +//BFS01 +//BFS01 Color aCol; +//BFS01 +//BFS01 rIn >> aCol; +//BFS01 SetMaterialAmbientColor(aCol); +//BFS01 +//BFS01 rIn >> aCol; +//BFS01 // do NOT use, this is the old 3D-Color(!) +//BFS01 // SetItem(XFillColorItem(String(), aCol)); +//BFS01 +//BFS01 rIn >> aCol; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DMaterialSpecularItem(aCol)); +//BFS01 +//BFS01 rIn >> aCol; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DMaterialEmissionItem(aCol)); +//BFS01 +//BFS01 rIn >> nTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DMaterialSpecularIntensityItem(nTmp)); +//BFS01 +//BFS01 aBackMaterial.ReadData(rIn); +//BFS01 +//BFS01 rIn >> nTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DTextureKindItem(nTmp)); +//BFS01 +//BFS01 rIn >> nTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DTextureModeItem(nTmp)); +//BFS01 +//BFS01 rIn >> bTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DNormalsInvertItem(bTmp)); +//BFS01 } +//BFS01 +//BFS01 if (aCompat.GetBytesLeft()) +//BFS01 { +//BFS01 // Ab Version 513a (5.2.99): Parameter fuer das +//BFS01 // Erzeugen der Vorder/Rueckwand +//BFS01 BOOL bTmp; +//BFS01 +//BFS01 rIn >> bTmp; // #107245# bLatheCloseFront = bTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DCloseFrontItem(bTmp)); +//BFS01 +//BFS01 rIn >> bTmp; // #107245# bLatheCloseBack = bTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DCloseBackItem(bTmp)); +//BFS01 } +//BFS01 else +//BFS01 { +//BFS01 // #107245# bLatheCloseFront = TRUE; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DCloseFrontItem(sal_True)); +//BFS01 +//BFS01 // #107245# bLatheCloseBack = TRUE; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DCloseBackItem(sal_True)); +//BFS01 } +//BFS01 +//BFS01 // neu ab 534: (hat noch gefehlt) +//BFS01 if (aCompat.GetBytesLeft () >= sizeof (BOOL)) +//BFS01 { +//BFS01 BOOL bTmp; +//BFS01 rIn >> bTmp; +//BFS01 GetProperties().SetObjectItemDirect(Svx3DTextureFilterItem(bTmp)); +//BFS01 } +//BFS01 } +//BFS01 +//BFS01 // correct position of extrude polygon, in case it's not positioned +//BFS01 // at the Z==0 layer +//BFS01 if(aPolyPoly3D.Count() && aPolyPoly3D[0].GetPointCount()) +//BFS01 { +//BFS01 const Vector3D& rFirstPoint = aPolyPoly3D[0][0]; +//BFS01 if(rFirstPoint.Z() != 0.0) +//BFS01 { +//BFS01 // change transformation so that source poly lies in Z == 0, +//BFS01 // so it can be exported as 2D polygon +//BFS01 // +//BFS01 // ATTENTION: the translation has to be multiplied from LEFT +//BFS01 // SIDE since it was executed as the first translate for this +//BFS01 // 3D object during it's creation. +//BFS01 double fTransDepth(rFirstPoint.Z()); +//BFS01 Matrix4D aTransMat; +//BFS01 aTransMat.TranslateZ(fTransDepth); +//BFS01 NbcSetTransform(GetTransform() * aTransMat); // #112587# +//BFS01 +//BFS01 // correct polygon itself +//BFS01 aTransMat.Identity(); +//BFS01 aTransMat.TranslateZ(-fTransDepth); +//BFS01 aPolyPoly3D.Transform(aTransMat); +//BFS01 } +//BFS01 } +//BFS01 +//BFS01 // Geometrie neu erzeugen +//BFS01 ReCreateGeometry(); +//BFS01} /************************************************************************* |* @@ -1159,4 +1158,4 @@ SdrAttrObj* E3dLatheObj::GetBreakObj() return pPathObj; } -// EOF +// eof |