// Copyright (c) 2005-2011 Code Synthesis Tools CC
//
// This program was generated by CodeSynthesis XSD/e, an XML Schema
// to C++ data binding compiler for embedded systems.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
//

// Begin prologue.
//
//
// End prologue.

#include "SceneDescription-pimpl.h"

#include <xsde/cxx/parser/validating/string-common.hxx>

// Vector_pimpl
//

void Vector_pimpl::
pre ()
{
  this->Vector_pimpl_state_.Vector_ = ::Vector ();
}

void Vector_pimpl::
X (float x)
{
  this->Vector_pimpl_state_.Vector_.X (x);
}

void Vector_pimpl::
Y (float x)
{
  this->Vector_pimpl_state_.Vector_.Y (x);
}

void Vector_pimpl::
Z (float x)
{
  this->Vector_pimpl_state_.Vector_.Z (x);
}

::Vector Vector_pimpl::
post_Vector ()
{
  return this->Vector_pimpl_state_.Vector_;
}

// Color_pimpl
//

void Color_pimpl::
pre ()
{
  this->Color_pimpl_state_.Color_ = ::Color ();
}

void Color_pimpl::
R (float x)
{
  this->Color_pimpl_state_.Color_.R (x);
}

void Color_pimpl::
G (float x)
{
  this->Color_pimpl_state_.Color_.G (x);
}

void Color_pimpl::
B (float x)
{
  this->Color_pimpl_state_.Color_.B (x);
}

::Color Color_pimpl::
post_Color ()
{
  return this->Color_pimpl_state_.Color_;
}

// BlockType_pimpl
//

void BlockType_pimpl::
pre ()
{
  this->BlockType_pimpl_state_.BlockType_ = ::BlockType ();
}

void BlockType_pimpl::
Mass (float x)
{
  this->BlockType_pimpl_state_.BlockType_.Mass (x);
}

void BlockType_pimpl::
Size (const ::Vector& x)
{
  this->BlockType_pimpl_state_.BlockType_.Size (x);
}

void BlockType_pimpl::
Location (const ::Vector& x)
{
  this->BlockType_pimpl_state_.BlockType_.Location (x);
}

void BlockType_pimpl::
Color (const ::Color& x)
{
  this->BlockType_pimpl_state_.BlockType_.Color (x);
}

void BlockType_pimpl::
Value (long x)
{
  this->BlockType_pimpl_state_.BlockType_.Value (x);
}

::BlockType BlockType_pimpl::
post_BlockType ()
{
  return this->BlockType_pimpl_state_.BlockType_;
}

// GroupReferenceType_pimpl
//

void GroupReferenceType_pimpl::
pre ()
{
  this->GroupReferenceType_pimpl_state_.GroupReferenceType_ = ::GroupReferenceType ();
}

void GroupReferenceType_pimpl::
Location (const ::Vector& x)
{
  this->GroupReferenceType_pimpl_state_.GroupReferenceType_.Location (x);
}

void GroupReferenceType_pimpl::
Color (const ::Color& x)
{
  this->GroupReferenceType_pimpl_state_.GroupReferenceType_.Color (x);
}

void GroupReferenceType_pimpl::
Ref (const ::std::string& x)
{
  this->GroupReferenceType_pimpl_state_.GroupReferenceType_.Ref (x);
}

::GroupReferenceType GroupReferenceType_pimpl::
post_GroupReferenceType ()
{
  return this->GroupReferenceType_pimpl_state_.GroupReferenceType_;
}

// GroupType_pimpl
//

GroupType_pimpl::
GroupType_pimpl (bool b)
{
  this->GroupType_pimpl_base_ = b;
  this->GroupType_pimpl_state_.GroupType_ = 0;
}

GroupType_pimpl::
~GroupType_pimpl ()
{
  if (!this->GroupType_pimpl_base_ && this->GroupType_pimpl_state_.GroupType_)
    delete this->GroupType_pimpl_state_.GroupType_;
}

void GroupType_pimpl::
_reset ()
{
  GroupType_pskel::_reset ();

  if (!this->GroupType_pimpl_base_ && this->GroupType_pimpl_state_.GroupType_)
  {
    delete this->GroupType_pimpl_state_.GroupType_;
    this->GroupType_pimpl_state_.GroupType_ = 0;
  }
}

void GroupType_pimpl::
pre_impl (::GroupType* x)
{
  this->GroupType_pimpl_state_.GroupType_ = x;
}

void GroupType_pimpl::
pre ()
{
  ::GroupType* x = new ::GroupType;
  this->pre_impl (x);
}

void GroupType_pimpl::
id (const ::std::string& x)
{
  this->GroupType_pimpl_state_.GroupType_->id (x);
}

void GroupType_pimpl::
choice_arm (choice_arm_tag t)
{
  this->GroupType_pimpl_state_.GroupType_->choice ().push_back (::GroupType::choice_type ());
  this->GroupType_pimpl_state_.choice_ = &this->GroupType_pimpl_state_.GroupType_->choice ().back ();
  this->GroupType_pimpl_state_.choice_->choice_arm (
    static_cast< ::GroupType::choice_type::choice_arm_tag > (t));
}

void GroupType_pimpl::
Block (const ::BlockType& x)
{
  this->GroupType_pimpl_state_.choice_->Block (x);
}

void GroupType_pimpl::
GroupReference (const ::GroupReferenceType& x)
{
  this->GroupType_pimpl_state_.choice_->GroupReference (x);
}

::GroupType* GroupType_pimpl::
post_GroupType ()
{
  ::GroupType* r = this->GroupType_pimpl_state_.GroupType_;
  this->GroupType_pimpl_state_.GroupType_ = 0;
  return r;
}

// SceneDescriptionType_pimpl
//

SceneDescriptionType_pimpl::
SceneDescriptionType_pimpl (bool b)
{
  this->SceneDescriptionType_pimpl_base_ = b;
  this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_ = 0;
}

SceneDescriptionType_pimpl::
~SceneDescriptionType_pimpl ()
{
  if (!this->SceneDescriptionType_pimpl_base_ && this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_)
    delete this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_;
}

void SceneDescriptionType_pimpl::
_reset ()
{
  SceneDescriptionType_pskel::_reset ();

  if (!this->SceneDescriptionType_pimpl_base_ && this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_)
  {
    delete this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_;
    this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_ = 0;
  }
}

void SceneDescriptionType_pimpl::
pre_impl (::SceneDescriptionType* x)
{
  this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_ = x;
}

void SceneDescriptionType_pimpl::
pre ()
{
  ::SceneDescriptionType* x = new ::SceneDescriptionType;
  this->pre_impl (x);
}

void SceneDescriptionType_pimpl::
Group (::GroupType* x)
{
  this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_->Group ().push_back (x);
}

void SceneDescriptionType_pimpl::
Base (const ::BlockType& x)
{
  this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_->Base (x);
}

void SceneDescriptionType_pimpl::
GroupReference (const ::GroupReferenceType& x)
{
  this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_->GroupReference ().push_back (x);
}

::SceneDescriptionType* SceneDescriptionType_pimpl::
post_SceneDescriptionType ()
{
  ::SceneDescriptionType* r = this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_;
  this->SceneDescriptionType_pimpl_state_.SceneDescriptionType_ = 0;
  return r;
}

// SceneDescription_paggr
//

SceneDescription_paggr::
SceneDescription_paggr ()
{
  this->Vector_p_.parsers (this->float_p_,
                           this->float_p_,
                           this->float_p_);

  this->Color_p_.parsers (this->float_p_,
                          this->float_p_,
                          this->float_p_);

  this->BlockType_p_.parsers (this->float_p_,
                              this->Vector_p_,
                              this->Vector_p_,
                              this->Color_p_,
                              this->integer_p_);

  this->GroupType_p_.parsers (this->id_p_,
                              this->BlockType_p_,
                              this->GroupReferenceType_p_);

  this->GroupReferenceType_p_.parsers (this->Vector_p_,
                                       this->Color_p_,
                                       this->idref_p_);

  this->SceneDescriptionType_p_.parsers (this->GroupType_p_,
                                         this->BlockType_p_,
                                         this->GroupReferenceType_p_);
}

const char* SceneDescription_paggr::
root_name ()
{
  return "SceneDescription";
}

const char* SceneDescription_paggr::
root_namespace ()
{
  return "";
}

// Begin epilogue.
//
//
// End epilogue.

