Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
David Thompson
SMTK
Commits
e8dabd05
Commit
e8dabd05
authored
Oct 30, 2015
by
David Thompson
Browse files
Accept an optional model name.
parent
a1cf4a09
Changes
4
Hide whitespace changes
Inline
Side-by-side
smtk/bridge/polygon/Session.cxx
View file @
e8dabd05
...
...
@@ -46,6 +46,7 @@ namespace smtk {
/// Default constructor.
Session
::
Session
()
:
m_nextModelNumber
(
0
)
{
this
->
initializeOperatorSystem
(
Session
::
s_operators
);
}
...
...
smtk/bridge/polygon/Session.h
View file @
e8dabd05
...
...
@@ -92,6 +92,7 @@ protected:
}
internal
::
EntityIdToPtr
m_storage
;
int
m_nextModelNumber
;
private:
Session
(
const
Session
&
);
// Not implemented.
...
...
smtk/bridge/polygon/operators/CreateModel.cxx
View file @
e8dabd05
...
...
@@ -84,8 +84,22 @@ smtk::model::OperatorResult CreateModel::operateInternal()
smtk
::
model
::
Manager
::
Ptr
mgr
;
if
(
sess
)
{
// If a name was specified, use it. Or make one up.
smtk
::
attribute
::
StringItem
::
Ptr
nameItem
=
this
->
findString
(
"name"
);
std
::
string
modelName
;
if
(
nameItem
&&
nameItem
->
isEnabled
())
{
modelName
=
nameItem
->
value
(
0
);
}
else
{
std
::
ostringstream
ss
;
ss
<<
"model "
<<
sess
->
m_nextModelNumber
++
;
modelName
=
ss
.
str
();
}
mgr
=
sess
->
manager
();
smtk
::
model
::
Model
model
=
mgr
->
addModel
(
/* par. dim. */
2
,
/* emb. dim. */
3
,
"
model
"
);
smtk
::
model
::
Model
model
=
mgr
->
addModel
(
/* par. dim. */
2
,
/* emb. dim. */
3
,
model
Name
);
storage
->
setId
(
model
.
entity
());
storage
->
setSession
(
sess
);
sess
->
addStorage
(
model
.
entity
(),
storage
);
...
...
smtk/bridge/polygon/operators/CreateModel.sbt
View file @
e8dabd05
...
...
@@ -9,7 +9,15 @@
Create
a
model
given
a
set
of
coordinate
axes
in
3D
and
a
minimum
feature
size
.
</
DetailedDescription
>
<
ItemDefinitions
>
<
Int
Name
=
"construction method"
>
<
String
Name
=
"name"
NumberOfValuesRequired
=
"1"
Optional
=
"true"
>
<
BriefDescription
>
A
user
-
assigned
name
for
the
model
.</
BriefDescription
>
<
DetailedDescription
>
A
user
-
assigned
name
for
the
model
.
The
name
need
not
be
unique
,
but
unique
names
are
best
.
If
not
assigned
,
a
machine
-
generated
name
will
be
assigned
.
</
DetailedDescription
>
</
String
>
<
Int
Name
=
"construction method"
AdvanceLevel
=
"1"
>
<
ChildrenDefinitions
>
<
Double
Name
=
"origin"
NumberOfRequiredValues
=
"3"
Optional
=
"true"
>
<
DefaultValue
>
0.
,
0.
,
0.
</
DefaultValue
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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