Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_goodies / b3dvolum.hxx
blob64e10a1fa6d478879006161613d1d7a487b8ffb7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: b3dvolum.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _B3D_VOLUM_HXX
32 #define _B3D_VOLUM_HXX
34 #ifndef _SVX_VECTOR3D_HXX
35 #include "vector3d.hxx"
36 #endif
38 #ifndef _INC_FLOAT
39 #include <float.h>
40 #endif
42 #ifndef _STREAM_HXX
43 #include <tools/stream.hxx>
44 #endif
46 /*************************************************************************
48 |* dreidimensionales Volumen, symmetrisch zu den Koordinatenachsen
50 \************************************************************************/
52 namespace binfilter {
53 class Vol3DPointIterator;
55 class B3dVolume
57 // friend class binfilter::Vol3DPointIterator; //STRIP008
58 friend class Vol3DPointIterator;
59 protected:
60 Vector3D aMinVec;
61 Vector3D aMaxVec;
63 public:
64 B3dVolume(const Vector3D& rPos, const Vector3D& r3DSize,
65 BOOL bPosIsCenter = TRUE);
66 B3dVolume();
68 void Reset();
69 BOOL IsValid() const;
71 B3dVolume& Union(const B3dVolume& rVol2);
72 B3dVolume& Union(const Vector3D& rVec);
74 const Vector3D& MinVec() const { return aMinVec; }
75 Vector3D& MinVec() { return aMinVec; }
77 const Vector3D& MaxVec() const { return aMaxVec; }
78 Vector3D& MaxVec() { return aMaxVec; }
80 double GetWidth() const { return aMaxVec.X() - aMinVec.X(); }
81 double GetHeight() const { return aMaxVec.Y() - aMinVec.Y(); }
82 double GetDepth() const { return aMaxVec.Z() - aMinVec.Z(); }
84 friend SvStream& operator>>(SvStream& rIStream, B3dVolume&);
85 friend SvStream& operator<<(SvStream& rOStream, const B3dVolume&);
87 }//end of namespace binfilter
90 #endif // _B3D_VOLUM_HXX