2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 23:45:19 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 23:45:19 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 23:45:19 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 23:45:19 +00:00
|
|
|
* $RCSfile: scene3d.cxx,v $
|
2008-10-17 08:40:10 +00:00
|
|
|
* $Revision: 1.34.18.1 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 23:45:19 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 23:45:19 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 23:45:19 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 23:45:19 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 03:58:39 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_svx.hxx"
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "svdstr.hrc"
|
|
|
|
#include "svdglob.hxx"
|
|
|
|
#include "svditer.hxx"
|
|
|
|
|
|
|
|
#if defined( UNX ) || defined( ICC )
|
|
|
|
#include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
#include "globl3d.hxx"
|
2007-06-27 17:05:11 +00:00
|
|
|
#include <svx/svdpage.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/style.hxx>
|
2007-06-27 17:05:11 +00:00
|
|
|
#include <svx/scene3d.hxx>
|
|
|
|
#include <svx/e3dundo.hxx>
|
|
|
|
#include <svx/svdtrans.hxx>
|
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#include <svx/colritem.hxx>
|
|
|
|
#include <svx/e3ditem.hxx>
|
|
|
|
#include <svx/xlntrit.hxx>
|
|
|
|
#include <svx/xfltrit.hxx>
|
|
|
|
#include <svx/svx3ditems.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/whiter.hxx>
|
2007-06-27 17:05:11 +00:00
|
|
|
#include <svx/xflftrit.hxx>
|
2003-11-24 15:37:52 +00:00
|
|
|
#include <svx/sdr/properties/e3dsceneproperties.hxx>
|
|
|
|
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
|
2007-06-27 17:05:11 +00:00
|
|
|
#include <svx/svddrag.hxx>
|
2008-10-17 08:40:10 +00:00
|
|
|
#include <helperminimaldepth3d.hxx>
|
2004-02-26 16:46:08 +00:00
|
|
|
#include <algorithm>
|
2008-10-17 08:40:10 +00:00
|
|
|
#include <drawinglayer/geometry/viewinformation3d.hxx>
|
|
|
|
#include <basegfx/polygon/b2dpolypolygontools.hxx>
|
|
|
|
#include <svx/e3dsceneupdater.hxx>
|
2004-02-26 16:46:08 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
|
|
|
|
|
2004-02-26 16:46:08 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// #110988#
|
|
|
|
|
|
|
|
class ImpRemap3DDepth
|
|
|
|
{
|
|
|
|
sal_uInt32 mnOrdNum;
|
|
|
|
double mfMinimalDepth;
|
|
|
|
|
|
|
|
// bitfield
|
|
|
|
unsigned mbIsScene : 1;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ImpRemap3DDepth(sal_uInt32 nOrdNum, double fMinimalDepth);
|
|
|
|
ImpRemap3DDepth(sal_uInt32 nOrdNum);
|
|
|
|
~ImpRemap3DDepth();
|
|
|
|
|
|
|
|
// for ::std::sort
|
|
|
|
bool operator<(const ImpRemap3DDepth& rComp) const;
|
|
|
|
|
|
|
|
sal_uInt32 GetOrdNum() const { return mnOrdNum; }
|
|
|
|
sal_Bool IsScene() const { return mbIsScene; }
|
|
|
|
};
|
|
|
|
|
|
|
|
ImpRemap3DDepth::ImpRemap3DDepth(sal_uInt32 nOrdNum, double fMinimalDepth)
|
|
|
|
: mnOrdNum(nOrdNum),
|
|
|
|
mfMinimalDepth(fMinimalDepth),
|
|
|
|
mbIsScene(sal_False)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
ImpRemap3DDepth::ImpRemap3DDepth(sal_uInt32 nOrdNum)
|
|
|
|
: mnOrdNum(nOrdNum),
|
|
|
|
mbIsScene(sal_True)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
ImpRemap3DDepth::~ImpRemap3DDepth()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ImpRemap3DDepth::operator<(const ImpRemap3DDepth& rComp) const
|
|
|
|
{
|
|
|
|
if(IsScene())
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if(rComp.IsScene())
|
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return mfMinimalDepth < rComp.mfMinimalDepth;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// typedefs for a vector of ImpRemap3DDepths
|
|
|
|
typedef ::std::vector< ImpRemap3DDepth > ImpRemap3DDepthVector;
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// #110988#
|
|
|
|
|
|
|
|
class Imp3DDepthRemapper
|
|
|
|
{
|
|
|
|
ImpRemap3DDepthVector maVector;
|
|
|
|
|
|
|
|
public:
|
|
|
|
Imp3DDepthRemapper(E3dScene& rScene);
|
|
|
|
~Imp3DDepthRemapper();
|
|
|
|
|
|
|
|
sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
Imp3DDepthRemapper::Imp3DDepthRemapper(E3dScene& rScene)
|
|
|
|
{
|
|
|
|
// only called when rScene.GetSubList() and nObjCount > 1L
|
|
|
|
SdrObjList* pList = rScene.GetSubList();
|
|
|
|
const sal_uInt32 nObjCount(pList->GetObjCount());
|
|
|
|
|
|
|
|
for(sal_uInt32 a(0L); a < nObjCount; a++)
|
|
|
|
{
|
|
|
|
SdrObject* pCandidate = pList->GetObj(a);
|
|
|
|
|
|
|
|
if(pCandidate)
|
|
|
|
{
|
|
|
|
if(pCandidate->ISA(E3dCompoundObject))
|
|
|
|
{
|
|
|
|
// single 3d object, calc depth
|
2008-10-17 08:40:10 +00:00
|
|
|
const double fMinimalDepth(getMinimalDepthInViewCoordinates(static_cast< const E3dCompoundObject& >(*pCandidate)));
|
2004-02-26 16:46:08 +00:00
|
|
|
ImpRemap3DDepth aEntry(a, fMinimalDepth);
|
|
|
|
maVector.push_back(aEntry);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// scene, use standard entry for scene
|
|
|
|
ImpRemap3DDepth aEntry(a);
|
|
|
|
maVector.push_back(aEntry);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// now, we need to sort the maVector by it's members minimal depth. The
|
|
|
|
// smaller, the nearer to the viewer.
|
|
|
|
::std::sort(maVector.begin(), maVector.end());
|
|
|
|
}
|
|
|
|
|
|
|
|
Imp3DDepthRemapper::~Imp3DDepthRemapper()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_uInt32 Imp3DDepthRemapper::RemapOrdNum(sal_uInt32 nOrdNum) const
|
|
|
|
{
|
|
|
|
if(nOrdNum < maVector.size())
|
|
|
|
{
|
|
|
|
nOrdNum = maVector[(maVector.size() - 1) - nOrdNum].GetOrdNum();
|
|
|
|
}
|
|
|
|
|
|
|
|
return nOrdNum;
|
|
|
|
}
|
|
|
|
|
2003-11-24 15:37:52 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// BaseProperties section
|
|
|
|
|
|
|
|
sdr::properties::BaseProperties* E3dScene::CreateObjectSpecificProperties()
|
|
|
|
{
|
|
|
|
return new sdr::properties::E3dSceneProperties(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// #110094# DrawContact section
|
|
|
|
|
|
|
|
sdr::contact::ViewContact* E3dScene::CreateObjectSpecificViewContact()
|
|
|
|
{
|
|
|
|
return new sdr::contact::ViewContactOfE3dScene(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
TYPEINIT1(E3dScene, E3dObject);
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* E3dScene-Konstruktor
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
E3dScene::E3dScene()
|
|
|
|
: E3dObject(),
|
2006-11-14 12:21:55 +00:00
|
|
|
aCamera(basegfx::B3DPoint(0.0, 0.0, 4.0), basegfx::B3DPoint()),
|
2004-02-26 16:46:08 +00:00
|
|
|
mp3DDepthRemapper(0L),
|
2008-10-17 08:40:10 +00:00
|
|
|
bDrawOnlySelected(false)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// Defaults setzen
|
|
|
|
E3dDefaultAttributes aDefault;
|
|
|
|
SetDefaultAttributes(aDefault);
|
|
|
|
}
|
|
|
|
|
|
|
|
E3dScene::E3dScene(E3dDefaultAttributes& rDefault)
|
|
|
|
: E3dObject(),
|
2006-11-14 12:21:55 +00:00
|
|
|
aCamera(basegfx::B3DPoint(0.0, 0.0, 4.0), basegfx::B3DPoint()),
|
2004-02-26 16:46:08 +00:00
|
|
|
mp3DDepthRemapper(0L),
|
2008-10-17 08:40:10 +00:00
|
|
|
bDrawOnlySelected(false)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// Defaults setzen
|
|
|
|
SetDefaultAttributes(rDefault);
|
|
|
|
}
|
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
void E3dScene::SetDefaultAttributes(E3dDefaultAttributes& /*rDefault*/)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// Fuer OS/2 die FP-Exceptions abschalten
|
|
|
|
#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
|
|
|
|
#if defined(WNT) || defined(WIN)
|
|
|
|
#define SC_FPEXCEPTIONS_ON() _control87( _MCW_EM, 0 )
|
|
|
|
#define SC_FPEXCEPTIONS_OFF() _control87( _MCW_EM, _MCW_EM )
|
|
|
|
SC_FPEXCEPTIONS_OFF();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Defaults setzen
|
|
|
|
aCamera.SetViewWindow(-2, -2, 4, 4);
|
|
|
|
aCameraSet.SetDeviceRectangle(-2, 2, -2, 2);
|
|
|
|
aCamera.SetDeviceWindow(Rectangle(0, 0, 10, 10));
|
|
|
|
Rectangle aRect(0, 0, 10, 10);
|
|
|
|
aCameraSet.SetViewportRectangle(aRect);
|
|
|
|
|
2000-11-07 11:58:28 +00:00
|
|
|
// set defaults for Camera from ItemPool
|
|
|
|
aCamera.SetProjection(GetPerspective());
|
2006-11-14 12:21:55 +00:00
|
|
|
basegfx::B3DPoint aActualPosition(aCamera.GetPosition());
|
2000-11-07 11:58:28 +00:00
|
|
|
double fNew = GetDistance();
|
2003-11-24 15:37:52 +00:00
|
|
|
|
2006-11-14 12:21:55 +00:00
|
|
|
if(fabs(fNew - aActualPosition.getZ()) > 1.0)
|
2003-11-24 15:37:52 +00:00
|
|
|
{
|
2006-11-14 12:21:55 +00:00
|
|
|
aCamera.SetPosition( basegfx::B3DPoint( aActualPosition.getX(), aActualPosition.getY(), fNew) );
|
2003-11-24 15:37:52 +00:00
|
|
|
}
|
|
|
|
|
2000-11-07 11:58:28 +00:00
|
|
|
fNew = GetFocalLength() / 100.0;
|
|
|
|
aCamera.SetFocalLength(fNew);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Destruktor
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
E3dScene::~E3dScene()
|
|
|
|
{
|
2004-02-26 16:46:08 +00:00
|
|
|
// #110988#
|
|
|
|
ImpCleanup3DDepthMapper();
|
|
|
|
}
|
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
basegfx::B2DPolyPolygon E3dScene::TakeXorPoly() const
|
|
|
|
{
|
|
|
|
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(GetViewContact());
|
|
|
|
const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
|
|
|
|
const basegfx::B3DPolyPolygon aCubePolyPolygon(CreateWireframe());
|
|
|
|
|
|
|
|
basegfx::B2DPolyPolygon aRetval(basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(aCubePolyPolygon,
|
|
|
|
aViewInfo3D.getObjectToView()));
|
|
|
|
aRetval.transform(rVCScene.getObjectTransformation());
|
|
|
|
|
|
|
|
return aRetval;
|
|
|
|
}
|
|
|
|
|
2004-02-26 16:46:08 +00:00
|
|
|
// #110988#
|
|
|
|
void E3dScene::ImpCleanup3DDepthMapper()
|
|
|
|
{
|
|
|
|
if(mp3DDepthRemapper)
|
|
|
|
{
|
|
|
|
delete mp3DDepthRemapper;
|
|
|
|
mp3DDepthRemapper = 0L;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// #110988#
|
2006-06-19 14:47:24 +00:00
|
|
|
sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const
|
2004-02-26 16:46:08 +00:00
|
|
|
{
|
|
|
|
if(!mp3DDepthRemapper)
|
|
|
|
{
|
|
|
|
const sal_uInt32 nObjCount(GetSubList() ? GetSubList()->GetObjCount() : 0L);
|
|
|
|
|
|
|
|
if(nObjCount > 1L)
|
|
|
|
{
|
|
|
|
((E3dScene*)this)->mp3DDepthRemapper = new Imp3DDepthRemapper((E3dScene&)(*this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(mp3DDepthRemapper)
|
|
|
|
{
|
2006-06-19 14:47:24 +00:00
|
|
|
return mp3DDepthRemapper->RemapOrdNum(nNewOrdNum);
|
2004-02-26 16:46:08 +00:00
|
|
|
}
|
|
|
|
|
2006-06-19 14:47:24 +00:00
|
|
|
return nNewOrdNum;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Identifier zurueckgeben
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
UINT16 E3dScene::GetObjIdentifier() const
|
|
|
|
{
|
|
|
|
return E3D_SCENE_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SetSnapRect
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void E3dScene::NbcSetSnapRect(const Rectangle& rRect)
|
|
|
|
{
|
|
|
|
SetRectsDirty();
|
|
|
|
E3dObject::NbcSetSnapRect(rRect);
|
|
|
|
aCamera.SetDeviceWindow(rRect);
|
|
|
|
aCameraSet.SetViewportRectangle((Rectangle&)rRect);
|
2004-02-26 16:46:08 +00:00
|
|
|
|
|
|
|
// #110988#
|
|
|
|
ImpCleanup3DDepthMapper();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Objekt verschieben
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void E3dScene::NbcMove(const Size& rSize)
|
|
|
|
{
|
|
|
|
Rectangle aNewSnapRect = GetSnapRect();
|
|
|
|
MoveRect(aNewSnapRect, rSize);
|
|
|
|
NbcSetSnapRect(aNewSnapRect);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Objekt Resizen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void E3dScene::NbcResize(const Point& rRef, const Fraction& rXFact,
|
|
|
|
const Fraction& rYFact)
|
|
|
|
{
|
|
|
|
Rectangle aNewSnapRect = GetSnapRect();
|
|
|
|
ResizeRect(aNewSnapRect, rRef, rXFact, rYFact);
|
|
|
|
NbcSetSnapRect(aNewSnapRect);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Neue Kamera setzen, und dabei die Szene und ggf. das BoundVolume
|
|
|
|
|* als geaendert markieren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void E3dScene::SetCamera(const Camera3D& rNewCamera)
|
|
|
|
{
|
|
|
|
// Alte Kamera setzen
|
|
|
|
aCamera = rNewCamera;
|
2003-11-24 15:37:52 +00:00
|
|
|
((sdr::properties::E3dSceneProperties&)GetProperties()).SetSceneItemsFromCamera();
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
SetRectsDirty();
|
|
|
|
|
|
|
|
// Neue Kamera aus alter fuellen
|
|
|
|
Camera3D& rCam = (Camera3D&)GetCamera();
|
|
|
|
|
|
|
|
// Ratio abschalten
|
|
|
|
if(rCam.GetAspectMapping() == AS_NO_MAPPING)
|
|
|
|
GetCameraSet().SetRatio(0.0);
|
|
|
|
|
|
|
|
// Abbildungsgeometrie setzen
|
2006-11-14 12:21:55 +00:00
|
|
|
basegfx::B3DPoint aVRP(rCam.GetViewPoint());
|
|
|
|
basegfx::B3DVector aVPN(aVRP - rCam.GetVRP());
|
|
|
|
basegfx::B3DVector aVUV(rCam.GetVUV());
|
2001-08-15 14:44:02 +00:00
|
|
|
|
|
|
|
// #91047# 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);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Perspektive setzen
|
|
|
|
GetCameraSet().SetPerspective(rCam.GetProjection() == PR_PERSPECTIVE);
|
|
|
|
GetCameraSet().SetViewportRectangle((Rectangle&)rCam.GetDeviceWindow());
|
|
|
|
|
2004-02-26 16:46:08 +00:00
|
|
|
// #110988#
|
|
|
|
ImpCleanup3DDepthMapper();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* 3D-Objekt einfuegen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void E3dScene::NewObjectInserted(const E3dObject* p3DObj)
|
|
|
|
{
|
|
|
|
E3dObject::NewObjectInserted(p3DObj);
|
|
|
|
|
|
|
|
if ( p3DObj == this )
|
|
|
|
return;
|
|
|
|
|
2004-02-26 16:46:08 +00:00
|
|
|
// #110988#
|
|
|
|
ImpCleanup3DDepthMapper();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Parent ueber Aenderung eines Childs informieren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
void E3dScene::StructureChanged()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-10-17 08:40:10 +00:00
|
|
|
E3dObject::StructureChanged();
|
2000-09-18 16:07:07 +00:00
|
|
|
SetRectsDirty();
|
2004-02-26 16:46:08 +00:00
|
|
|
|
|
|
|
// #110988#
|
|
|
|
ImpCleanup3DDepthMapper();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Uebergeordnetes Szenenobjekt bestimmen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
E3dScene* E3dScene::GetScene() const
|
|
|
|
{
|
|
|
|
if(GetParentObj())
|
|
|
|
return GetParentObj()->GetScene();
|
|
|
|
else
|
|
|
|
return (E3dScene*)this;
|
|
|
|
}
|
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
void E3dScene::removeAllNonSelectedObjects()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-10-17 08:40:10 +00:00
|
|
|
E3DModifySceneSnapRectUpdater aUpdater(this);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
for(sal_uInt32 a(0); a < maSubList.GetObjCount(); a++)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-10-17 08:40:10 +00:00
|
|
|
SdrObject* pObj = maSubList.GetObj(a);
|
2004-02-26 16:46:08 +00:00
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
if(pObj)
|
|
|
|
{
|
|
|
|
bool bRemoveObject(false);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
if(pObj->ISA(E3dScene))
|
|
|
|
{
|
|
|
|
E3dScene* pScene = (E3dScene*)pObj;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
// iterate over this sub-scene
|
|
|
|
pScene->removeAllNonSelectedObjects();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
// check object count. Empty scenes can be deleted
|
|
|
|
const sal_uInt32 nObjCount(pScene->GetSubList() ? pScene->GetSubList()->GetObjCount() : 0);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
if(!nObjCount)
|
|
|
|
{
|
|
|
|
// all objects removed, scene can be removed, too
|
|
|
|
bRemoveObject = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(pObj->ISA(E3dCompoundObject))
|
|
|
|
{
|
|
|
|
E3dCompoundObject* pCompound = (E3dCompoundObject*)pObj;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
if(!pCompound->GetSelected())
|
|
|
|
{
|
|
|
|
bRemoveObject = true;
|
|
|
|
}
|
|
|
|
}
|
2006-11-14 12:21:55 +00:00
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
if(bRemoveObject)
|
|
|
|
{
|
|
|
|
maSubList.NbcRemoveObject(pObj->GetOrdNum());
|
|
|
|
a--;
|
|
|
|
SdrObject::Free(pObj);
|
|
|
|
}
|
|
|
|
}
|
2006-11-14 12:21:55 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Zuweisungsoperator
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void E3dScene::operator=(const SdrObject& rObj)
|
|
|
|
{
|
|
|
|
E3dObject::operator=(rObj);
|
|
|
|
|
|
|
|
const E3dScene& r3DObj = (const E3dScene&) rObj;
|
|
|
|
aCamera = r3DObj.aCamera;
|
|
|
|
|
|
|
|
// neu ab 377:
|
|
|
|
aCameraSet = r3DObj.aCameraSet;
|
2003-11-24 15:37:52 +00:00
|
|
|
((sdr::properties::E3dSceneProperties&)GetProperties()).SetSceneItemsFromCamera();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
// SetSnapRect(r3DObj.GetSnapRect());
|
|
|
|
InvalidateBoundVolume();
|
2000-09-18 16:07:07 +00:00
|
|
|
RebuildLists();
|
|
|
|
SetRectsDirty();
|
2004-02-26 16:46:08 +00:00
|
|
|
|
|
|
|
// #110988#
|
|
|
|
ImpCleanup3DDepthMapper();
|
2009-07-27 16:24:52 +00:00
|
|
|
|
|
|
|
// #i101941#
|
|
|
|
// After a Scene as model object is cloned, the used
|
|
|
|
// ViewContactOfE3dScene is created and partially used
|
|
|
|
// to calculate Bound/SnapRects, but - since quite some
|
|
|
|
// values are buffered at the VC - not really well
|
|
|
|
// initialized. It would be possible to always watch for
|
|
|
|
// preconditions of buffered data, but this would be expensive
|
|
|
|
// and would create a lot of short living data structures.
|
|
|
|
// It is currently better to flush that data, e.g. by using
|
|
|
|
// ActionChanged at the VC which will for this class
|
|
|
|
// flush that cached data and initalize it's valid reconstruction
|
|
|
|
GetViewContact().ActionChanged();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Licht- und Labelobjektlisten neu aufbauen (nach Laden, Zuweisung)
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void E3dScene::RebuildLists()
|
|
|
|
{
|
|
|
|
// zuerst loeschen
|
2006-06-19 14:47:24 +00:00
|
|
|
SdrLayerID nCurrLayerID = GetLayer();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
SdrObjListIter a3DIterator(maSubList, IM_FLAT);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// dann alle Objekte in der Szene pruefen
|
|
|
|
while ( a3DIterator.IsMore() )
|
|
|
|
{
|
|
|
|
E3dObject* p3DObj = (E3dObject*) a3DIterator.Next();
|
2006-06-19 14:47:24 +00:00
|
|
|
p3DObj->NbcSetLayer(nCurrLayerID);
|
2000-09-18 16:07:07 +00:00
|
|
|
NewObjectInserted(p3DObj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* 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);
|
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
((E3DSceneGeoData &) rGeo).aCamera = aCamera;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* uebernehme werte aus dem GeoData-Objekt
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void E3dScene::RestGeoData(const SdrObjGeoData& rGeo)
|
|
|
|
{
|
2009-01-20 09:49:16 +00:00
|
|
|
// #i94832# removed E3DModifySceneSnapRectUpdater here.
|
|
|
|
// It should not be needed, is already part of E3dObject::RestGeoData
|
2000-09-18 16:07:07 +00:00
|
|
|
E3dObject::RestGeoData (rGeo);
|
|
|
|
SetCamera (((E3DSceneGeoData &) rGeo).aCamera);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Am StyleSheet wurde etwas geaendert, also Scene aendern
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2008-09-30 06:36:06 +00:00
|
|
|
void E3dScene::Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
SetRectsDirty();
|
2008-09-30 06:36:06 +00:00
|
|
|
E3dObject::Notify(rBC, rHint);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2006-06-19 14:47:24 +00:00
|
|
|
void E3dScene::RotateScene (const Point& rRef, long /*nWink*/, double sn, double cs)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
Point UpperLeft, LowerRight, Center, NewCenter;
|
|
|
|
|
|
|
|
UpperLeft = aOutRect.TopLeft();
|
|
|
|
LowerRight = aOutRect.BottomRight();
|
|
|
|
|
|
|
|
long dxOutRectHalf = labs(UpperLeft.X() - LowerRight.X());
|
|
|
|
dxOutRectHalf /= 2;
|
|
|
|
long dyOutRectHalf = labs(UpperLeft.Y() - LowerRight.Y());
|
|
|
|
dyOutRectHalf /= 2;
|
|
|
|
|
|
|
|
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
|
|
|
|
Center.X() = (UpperLeft.X() + dxOutRectHalf) - rRef.X();
|
|
|
|
Center.Y() = -((UpperLeft.Y() + dyOutRectHalf) - rRef.Y());
|
|
|
|
// Ein paar Spezialfaelle zuerst abhandeln (n*90 Grad n ganzzahlig)
|
2005-02-16 16:55:24 +00:00
|
|
|
if (sn==1.0 && cs==0.0) { // 90deg
|
2000-09-18 16:07:07 +00:00
|
|
|
NewCenter.X() = -Center.Y();
|
|
|
|
NewCenter.Y() = -Center.X();
|
2005-02-16 16:55:24 +00:00
|
|
|
} else if (sn==0.0 && cs==-1.0) { // 180deg
|
2000-09-18 16:07:07 +00:00
|
|
|
NewCenter.X() = -Center.X();
|
|
|
|
NewCenter.Y() = -Center.Y();
|
2005-02-16 16:55:24 +00:00
|
|
|
} else if (sn==-1.0 && cs==0.0) { // 270deg
|
2000-09-18 16:07:07 +00:00
|
|
|
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.
|
|
|
|
NewCenter.X() = (long) (Center.X() * cs - Center.Y() * sn);
|
|
|
|
NewCenter.Y() = (long) (Center.X() * sn + Center.Y() * cs);
|
|
|
|
}
|
|
|
|
|
|
|
|
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.
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Get the name of the object (singular)
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void E3dScene::TakeObjNameSingul(XubString& rName) const
|
|
|
|
{
|
|
|
|
rName=ImpGetResStr(STR_ObjNameSingulScene3d);
|
2002-06-07 11:08:48 +00:00
|
|
|
|
|
|
|
String aName( GetName() );
|
|
|
|
if(aName.Len())
|
|
|
|
{
|
|
|
|
rName += sal_Unicode(' ');
|
|
|
|
rName += sal_Unicode('\'');
|
|
|
|
rName += aName;
|
|
|
|
rName += sal_Unicode('\'');
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Get the name of the object (plural)
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void E3dScene::TakeObjNamePlural(XubString& rName) const
|
|
|
|
{
|
|
|
|
rName=ImpGetResStr(STR_ObjNamePluralScene3d);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
2005-02-16 16:55:24 +00:00
|
|
|
|* Die NbcRotate-Routine ueberlaedt die des SdrObject. Die Idee ist die Scene
|
2000-09-18 16:07:07 +00:00
|
|
|
|* drehen zu koennen und relativ zur Lage der Scene dann auch die Objekte
|
|
|
|
|* in der Scene
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
void E3dScene::NbcSetTransform(const basegfx::B3DHomMatrix& rMatrix)
|
|
|
|
{
|
|
|
|
if(maTransformation != rMatrix)
|
|
|
|
{
|
|
|
|
// call parent
|
|
|
|
E3dObject::NbcSetTransform(rMatrix);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void E3dScene::SetTransform(const basegfx::B3DHomMatrix& rMatrix)
|
|
|
|
{
|
|
|
|
if(rMatrix != maTransformation)
|
|
|
|
{
|
|
|
|
// call parent
|
|
|
|
E3dObject::SetTransform(rMatrix);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
void E3dScene::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
|
|
|
|
{
|
2008-10-17 08:40:10 +00:00
|
|
|
// 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
|
2000-09-18 16:07:07 +00:00
|
|
|
SetGlueReallyAbsolute(TRUE);
|
|
|
|
|
2008-10-17 08:40:10 +00:00
|
|
|
// 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
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
RotateScene (rRef, nWink, sn, cs); // Rotiert die Szene
|
|
|
|
double fWinkelInRad = nWink/100 * F_PI180;
|
2008-10-17 08:40:10 +00:00
|
|
|
|
|
|
|
basegfx::B3DHomMatrix aRotation;
|
|
|
|
aRotation.rotate(0.0, 0.0, fWinkelInRad);
|
|
|
|
NbcSetTransform(aRotation * GetTransform());
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
SetRectsDirty(); // Veranlasst eine Neuberechnung aller BoundRects
|
|
|
|
NbcRotateGluePoints(rRef,nWink,sn,cs); // Rotiert die Klebepunkte (die haben noch Koordinaten relativ
|
|
|
|
// zum Urpsung des Blattes
|
|
|
|
SetGlueReallyAbsolute(FALSE); // ab jetzt sind sie wieder relativ zum BoundRect (also dem aOutRect definiert)
|
|
|
|
SetRectsDirty();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SnapRect berechnen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void E3dScene::RecalcSnapRect()
|
|
|
|
{
|
|
|
|
E3dScene* pScene = GetScene();
|
2008-10-17 08:40:10 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if(pScene == this)
|
|
|
|
{
|
|
|
|
// Szene wird als 2D-Objekt benutzt, nimm SnapRect aus der
|
|
|
|
// 2D Bildschrimdarstellung
|
|
|
|
Camera3D& rCam = (Camera3D&)pScene->GetCamera();
|
2000-10-30 10:00:01 +00:00
|
|
|
maSnapRect = rCam.GetDeviceWindow();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Szene ist selbst Mitglied einer anderen Szene, hole das
|
|
|
|
// SnapRect als zusammengesetztes Objekt
|
|
|
|
E3dObject::RecalcSnapRect();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Aufbrechen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
BOOL E3dScene::IsBreakObjPossible()
|
|
|
|
{
|
|
|
|
// Szene ist aufzubrechen, wenn alle Mitglieder aufzubrechen sind
|
2008-10-17 08:40:10 +00:00
|
|
|
SdrObjListIter a3DIterator(maSubList, IM_DEEPWITHGROUPS);
|
|
|
|
|
|
|
|
while ( a3DIterator.IsMore() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-10-17 08:40:10 +00:00
|
|
|
E3dObject* pObj = (E3dObject*) a3DIterator.Next();
|
|
|
|
DBG_ASSERT(pObj->ISA(E3dObject), "AW: In Szenen sind nur 3D-Objekte erlaubt!");
|
|
|
|
if(!pObj->IsBreakObjPossible())
|
|
|
|
return FALSE;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2008-10-17 08:40:10 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2006-11-14 12:21:55 +00:00
|
|
|
basegfx::B3DVector E3dScene::GetShadowPlaneDirection() const
|
2000-10-30 10:00:01 +00:00
|
|
|
{
|
2000-11-07 11:58:28 +00:00
|
|
|
double fWink = (double)GetShadowSlant() * F_PI180;
|
2006-11-14 12:21:55 +00:00
|
|
|
basegfx::B3DVector aShadowPlaneDir(0.0, sin(fWink), cos(fWink));
|
|
|
|
aShadowPlaneDir.normalize();
|
2000-11-07 11:58:28 +00:00
|
|
|
return aShadowPlaneDir;
|
2000-10-30 10:00:01 +00:00
|
|
|
}
|
|
|
|
|
2006-11-14 12:21:55 +00:00
|
|
|
void E3dScene::SetShadowPlaneDirection(const basegfx::B3DVector& rVec)
|
2000-10-30 10:00:01 +00:00
|
|
|
{
|
2006-11-14 12:21:55 +00:00
|
|
|
UINT16 nSceneShadowSlant = (UINT16)((atan2(rVec.getY(), rVec.getZ()) / F_PI180) + 0.5);
|
2003-11-24 15:37:52 +00:00
|
|
|
GetProperties().SetObjectItemDirect(Svx3DShadowSlantItem(nSceneShadowSlant));
|
2000-10-30 10:00:01 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-11-14 12:21:55 +00:00
|
|
|
basegfx::B2DPolyPolygon E3dScene::TakeCreatePoly(const SdrDragStat& /*rDrag*/) const
|
|
|
|
{
|
2008-10-17 08:40:10 +00:00
|
|
|
return TakeXorPoly();
|
2006-11-14 12:21:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
FASTBOOL E3dScene::BegCreate(SdrDragStat& rStat)
|
|
|
|
{
|
|
|
|
rStat.SetOrtho4Possible();
|
|
|
|
Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
|
|
|
|
aRect1.Justify();
|
|
|
|
rStat.SetActionRect(aRect1);
|
|
|
|
NbcSetSnapRect(aRect1);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
FASTBOOL E3dScene::MovCreate(SdrDragStat& rStat)
|
|
|
|
{
|
|
|
|
Rectangle aRect1;
|
|
|
|
rStat.TakeCreateRect(aRect1);
|
|
|
|
aRect1.Justify();
|
|
|
|
rStat.SetActionRect(aRect1);
|
|
|
|
NbcSetSnapRect(aRect1);
|
2008-08-19 21:59:37 +00:00
|
|
|
SetBoundRectDirty();
|
2006-11-14 12:21:55 +00:00
|
|
|
bSnapRectDirty=TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
FASTBOOL E3dScene::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
|
|
|
{
|
|
|
|
Rectangle aRect1;
|
|
|
|
rStat.TakeCreateRect(aRect1);
|
|
|
|
aRect1.Justify();
|
|
|
|
NbcSetSnapRect(aRect1);
|
|
|
|
SetRectsDirty();
|
|
|
|
return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2);
|
|
|
|
}
|
|
|
|
|
|
|
|
FASTBOOL E3dScene::BckCreate(SdrDragStat& /*rStat*/)
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void E3dScene::BrkCreate(SdrDragStat& /*rStat*/)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-05-10 13:29:12 +00:00
|
|
|
// eof
|