our
$VERSION
=
'0.015'
;
sub
SET_DESCRIPTION {
my
(
$this
,
$description
) =
@_
;
my
$typeName
=
$description
->{typeName};
my
$defaultValue
= X3D::Parse::FieldValue::parse(
$typeName
, @{
$description
->{body} } );
my
$fieldDefinition
= new X3DFieldDefinition(
$typeName
, YES, YES,
''
,
$defaultValue
,
''
);
$this
->X3DPackage::Scalar(
"X3DDefaultDefinition"
) =
$fieldDefinition
;
}
'='
=>
'getClone'
,
'bool'
=>
sub
{
$_
[0]->getValue ? YES : NO },
;
sub
new {
my
$this
=
shift
->X3DObject::new;
$this
->setDefinition(
$this
->X3DPackage::Scalar(
"X3DDefaultDefinition"
) );
$this
->create;
if
(
@_
) {
$this
->setValue(
@_
);
$this
->setTainted(NO);
}
return
$this
;
}
sub
create { }
sub
getClone {
$_
[0]->new(
$_
[0]->getValue ) }
*getCopy
= \
&getClone
;
sub
getDefinition {
$_
[0]->{definition} }
sub
setDefinition {
$_
[0]->{definition} =
$_
[1] }
sub
getDefaultValue {
$_
[0]->X3DPackage::Scalar(
"X3DDefaultDefinition"
)->getValue }
sub
getInitialValue {
$_
[0]->getDefinition->getValue }
sub
getAccessType {
$_
[0]->getDefinition->getAccessType }
sub
getName {
$_
[0]->getDefinition->getName }
sub
getValue {
$_
[0]->{value} }
sub
setValue {
my
(
$this
,
$value
) =
@_
;
$this
->{value} =
$value
;
$this
->setTainted(
time
);
return
;
}
sub
toString {
sprintf
"%s"
,
$_
[0]->getValue }
1;