1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 3 of the License, or (at your
14 option) any later version.
16 cfMesh is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
28 Checks if a box is contained inside the box object
33 \*---------------------------------------------------------------------------*/
38 #include "coordinateModification.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class boxScaling Declaration
49 \*---------------------------------------------------------------------------*/
53 public coordinateModification
59 //- length of box sides
62 //- scaling factors in all directions
71 // Private member functions
72 //- calculate bounding box points
73 void calculateBndBox();
77 //- Runtime type information
86 //- Construct from name, cell size, centre and sizes and scaling factors
94 const scalar scaleX = 1.0,
95 const scalar scaleY = 1.0,
96 const scalar scaleZ = 1.0
99 //- Construct from dictionary
100 boxScaling(const word& name, const dictionary& dict);
102 //- Construct and return a clone
103 virtual autoPtr<coordinateModification> clone
108 return autoPtr<coordinateModification>
126 //- return the centre of the box
127 virtual point origin() const;
129 //- translate the object to the modified coordinates
130 //- this is needed for backward transformation
131 virtual void translateAndModifyObject(const vector&);
133 //- calculate the displacement vector for box scaling
134 virtual vector displacement(const point&) const;
136 //- calculate the displacement vector for box scaling
137 virtual vector backwardDisplacement(const point&) const;
139 //- can this modification object be combined with other ones
140 virtual bool combiningPossible() const;
142 //- return that "bounding planes" of the scaling region for
144 virtual void boundingPlanes(PtrList<plane>&) const;
146 //- Return as dictionary of entries
147 dictionary dict(bool ignoreType = false) const;
152 void write(Ostream&) const;
155 void writeDict(Ostream&, bool subDict = true) const;
159 //- assign from dictionary
160 void operator=(const dictionary&);
162 // IOstream Operators
164 Ostream& operator<<(Ostream&) const;
165 friend Ostream& operator<<(Ostream&, const boxScaling&);
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 } // End namespace Foam
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 // ************************************************************************* //