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 Applies scaling to points on the positive side of the plane within
34 \*---------------------------------------------------------------------------*/
36 #ifndef planeScaling_H
37 #define planeScaling_H
39 #include "coordinateModification.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class planeScaling Declaration
48 \*---------------------------------------------------------------------------*/
52 public coordinateModification
55 //- origin of the plane
62 scalar scalingDistance_;
65 scalar scalingFactor_;
69 //- Runtime type information
78 //- Construct from name, origin, normal, translation distance and scale
82 const point& original,
84 const scalar scalingDistance,
85 const scalar scalingFactor
88 //- Construct from dictionary
89 planeScaling(const word& name, const dictionary& dict);
91 //- Construct and return a clone
92 virtual autoPtr<coordinateModification> clone
94 const planeScaling& pt
97 return autoPtr<coordinateModification>
112 //- return the origin of the plane
113 virtual point origin() const;
115 //- translate the object to the modified coordinates
116 //- this is needed for backward transformation
117 virtual void translateAndModifyObject(const vector&);
119 //- calculate the displacement vector for plane translation
120 virtual vector displacement(const point&) const;
122 //- calculate the displacement vector for plane translation
123 virtual vector backwardDisplacement(const point&) const;
125 //- can this modification object be combined with other ones
126 virtual bool combiningPossible() const;
128 //- return that "bounding planes" of the scaling region for
130 virtual void boundingPlanes(PtrList<plane>&) const;
132 //- Return as dictionary of entries
133 dictionary dict(bool ignoreType = false) const;
138 void write(Ostream&) const;
141 void writeDict(Ostream&, bool subDict = true) const;
145 //- assign from dictionary
146 void operator=(const dictionary&);
148 // IOstream Operators
150 Ostream& operator<<(Ostream&) const;
151 friend Ostream& operator<<(Ostream&, const planeScaling&);
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 } // End namespace Foam
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 // ************************************************************************* //