Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
30eac79d
Commit
30eac79d
authored
Dec 09, 2009
by
Mark Olesen
Browse files
argList gets addNote() static method
- output any notes in the usage
parent
dd8f4f65
Changes
3
Hide whitespace changes
Inline
Side-by-side
applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C
View file @
30eac79d
...
...
@@ -23,8 +23,8 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Transform (scale/rotate) a surface.
Like transformPoints but then for
surfaces.
Transform (scale/rotate) a surface.
Like transformPoints but for
surfaces.
The rollPitchYaw option takes three angles (degrees):
- roll (rotation about x) followed by
...
...
@@ -54,16 +54,47 @@ using namespace Foam::constant::mathematical;
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Transform (scale/rotate) a surface. "
"Like transformPoints but for surfaces."
);
argList
::
noParallel
();
argList
::
validArgs
.
clear
();
argList
::
validArgs
.
append
(
"surface file"
);
argList
::
validArgs
.
append
(
"output surface file"
);
argList
::
addOption
(
"translate"
,
"vector"
);
argList
::
addOption
(
"rotate"
,
"(vector vector)"
);
argList
::
addOption
(
"scale"
,
"vector"
);
argList
::
addOption
(
"rollPitchYaw"
,
"(roll pitch yaw)"
);
argList
::
addOption
(
"yawPitchRoll"
,
"(yaw pitch roll)"
);
argList
::
addOption
(
"translate"
,
"vector"
,
"translate by the specified <vector> - eg, '(1 0 0)'"
);
argList
::
addOption
(
"rotate"
,
"(vectorA vectorB)"
,
"transform in terms of a rotation between <vectorA> and <vectorB> "
"- eg, '( (1 0 0) (0 0 1) )'"
);
argList
::
addOption
(
"scale"
,
"vector"
,
"scale by the specified amount - eg, '(0.001 0.001 0.001)' for a "
"uniform [mm] to [m] scaling"
);
argList
::
addOption
(
"rollPitchYaw"
,
"vector"
,
"transform in terms of '( roll pitch yaw )' in degrees"
);
argList
::
addOption
(
"yawPitchRoll"
,
"vector"
,
"transform in terms of '( yaw pitch roll )' in degrees"
);
argList
args
(
argc
,
argv
);
fileName
surfFileName
(
args
.
additionalArgs
()[
0
]);
...
...
src/OpenFOAM/global/argList/argList.C
View file @
30eac79d
...
...
@@ -43,6 +43,7 @@ Foam::SLList<Foam::string> Foam::argList::validArgs;
Foam
::
HashTable
<
Foam
::
string
>
Foam
::
argList
::
validOptions
;
Foam
::
HashTable
<
Foam
::
string
>
Foam
::
argList
::
validParOptions
;
Foam
::
HashTable
<
Foam
::
string
>
Foam
::
argList
::
optionUsage
;
Foam
::
SLList
<
Foam
::
string
>
Foam
::
argList
::
notes
;
Foam
::
string
::
size_type
Foam
::
argList
::
usageMin
=
20
;
Foam
::
string
::
size_type
Foam
::
argList
::
usageMax
=
80
;
...
...
@@ -108,6 +109,15 @@ void Foam::argList::addUsage
}
void
Foam
::
argList
::
addNote
(
const
string
&
note
)
{
if
(
!
note
.
empty
())
{
notes
.
append
(
note
);
}
}
void
Foam
::
argList
::
removeOption
(
const
word
&
opt
)
{
validOptions
.
erase
(
opt
);
...
...
@@ -765,7 +775,7 @@ void Foam::argList::printUsage() const
HashTable
<
string
>::
const_iterator
iter
=
validOptions
.
find
(
optionName
);
Info
<<
" -"
<<
optionName
;
label
len
=
optionName
.
size
()
+
3
;
// include leading
"
-
"
label
len
=
optionName
.
size
()
+
3
;
//
length
include
s
leading
'
-
'
if
(
iter
().
size
())
{
...
...
@@ -815,6 +825,22 @@ void Foam::argList::printUsage() const
"print the usage"
);
// output notes directly - no automatic text wrapping
if
(
!
notes
.
empty
())
{
Info
<<
nl
;
for
(
SLList
<
string
>::
const_iterator
iter
=
notes
.
begin
();
iter
!=
notes
.
end
();
++
iter
)
{
Info
<<
iter
().
c_str
()
<<
nl
;
}
}
Info
<<
nl
<<
"Using OpenFOAM-"
<<
Foam
::
FOAMversion
<<
" (build: "
<<
Foam
::
FOAMbuild
<<
") - see www.OpenFOAM.org"
...
...
src/OpenFOAM/global/argList/argList.H
View file @
30eac79d
...
...
@@ -153,7 +153,10 @@ public:
//- Short usage information for validOptions
static
HashTable
<
string
>
optionUsage
;
//- Min offset for displaying usage (default: 16)
//- Additional notes for usage
static
SLList
<
string
>
notes
;
//- Min offset for displaying usage (default: 20)
static
string
::
size_type
usageMin
;
//- Max screen width for displaying usage (default: 80)
...
...
@@ -287,6 +290,10 @@ public:
const
string
&
usage
);
//- Add extra notes for the usage information
// This string is used "as-is" without additional formatting
static
void
addNote
(
const
string
&
);
//- Remove option from validOptions and from optionUsage
static
void
removeOption
(
const
word
&
opt
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment