// 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
//
//

#include <xsde/cxx/pre.hxx>

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

#include "SceneDescription.h"

// Vector
//

float Vector::
X () const
{
  return this->X_;
}

float& Vector::
X ()
{
  return this->X_;
}

void Vector::
X (float x)
{
  this->X_ = x;
}

float Vector::
Y () const
{
  return this->Y_;
}

float& Vector::
Y ()
{
  return this->Y_;
}

void Vector::
Y (float x)
{
  this->Y_ = x;
}

float Vector::
Z () const
{
  return this->Z_;
}

float& Vector::
Z ()
{
  return this->Z_;
}

void Vector::
Z (float x)
{
  this->Z_ = x;
}

// Color
//

float Color::
R () const
{
  return this->R_;
}

float& Color::
R ()
{
  return this->R_;
}

void Color::
R (float x)
{
  this->R_ = x;
}

float Color::
G () const
{
  return this->G_;
}

float& Color::
G ()
{
  return this->G_;
}

void Color::
G (float x)
{
  this->G_ = x;
}

float Color::
B () const
{
  return this->B_;
}

float& Color::
B ()
{
  return this->B_;
}

void Color::
B (float x)
{
  this->B_ = x;
}

// BlockType
//

float BlockType::
Mass () const
{
  return this->Mass_;
}

float& BlockType::
Mass ()
{
  return this->Mass_;
}

void BlockType::
Mass (float x)
{
  this->Mass_ = x;
}

const ::Vector& BlockType::
Size () const
{
  return this->Size_;
}

::Vector& BlockType::
Size ()
{
  return this->Size_;
}

void BlockType::
Size (const ::Vector& x)
{
  this->Size_ = x;
}

const ::Vector& BlockType::
Location () const
{
  return this->Location_;
}

::Vector& BlockType::
Location ()
{
  return this->Location_;
}

void BlockType::
Location (const ::Vector& x)
{
  this->Location_ = x;
}

bool BlockType::
Color_present () const
{
  return this->Color_present_;
}

void BlockType::
Color_present (bool x)
{
  this->Color_present_ = x;
}

const ::Color& BlockType::
Color () const
{
  return this->Color_;
}

::Color& BlockType::
Color ()
{
  return this->Color_;
}

void BlockType::
Color (const ::Color& x)
{
  this->Color_ = x;
  this->Color_present_ = true;
}

bool BlockType::
Value_present () const
{
  return this->Value_present_;
}

void BlockType::
Value_present (bool x)
{
  this->Value_present_ = x;
}

long BlockType::
Value () const
{
  return this->Value_;
}

long& BlockType::
Value ()
{
  return this->Value_;
}

void BlockType::
Value (long x)
{
  this->Value_ = x;
  this->Value_present_ = true;
}

// GroupReferenceType
//

const ::Vector& GroupReferenceType::
Location () const
{
  return this->Location_;
}

::Vector& GroupReferenceType::
Location ()
{
  return this->Location_;
}

void GroupReferenceType::
Location (const ::Vector& x)
{
  this->Location_ = x;
}

bool GroupReferenceType::
Color_present () const
{
  return this->Color_present_;
}

void GroupReferenceType::
Color_present (bool x)
{
  this->Color_present_ = x;
}

const ::Color& GroupReferenceType::
Color () const
{
  return this->Color_;
}

::Color& GroupReferenceType::
Color ()
{
  return this->Color_;
}

void GroupReferenceType::
Color (const ::Color& x)
{
  this->Color_ = x;
  this->Color_present_ = true;
}

const ::std::string& GroupReferenceType::
Ref () const
{
  return this->Ref_;
}

::std::string& GroupReferenceType::
Ref ()
{
  return this->Ref_;
}

void GroupReferenceType::
Ref (const ::std::string& x)
{
  this->Ref_ = x;
}

// GroupType
//

const ::std::string& GroupType::
id () const
{
  return this->id_;
}

::std::string& GroupType::
id ()
{
  return this->id_;
}

void GroupType::
id (const ::std::string& x)
{
  this->id_ = x;
}

const GroupType::choice_sequence& GroupType::
choice () const
{
  return this->choice_;
}

GroupType::choice_sequence& GroupType::
choice ()
{
  return this->choice_;
}

GroupType::choice_type::choice_arm_tag GroupType::choice_type::
choice_arm () const
{
  return this->choice_arm_;
}

const ::BlockType& GroupType::choice_type::
Block () const
{
  return reinterpret_cast< const ::BlockType& > (this->choice_.Block_);
}

::BlockType& GroupType::choice_type::
Block ()
{
  return reinterpret_cast< ::BlockType& > (this->choice_.Block_);
}

void GroupType::choice_type::
Block (const ::BlockType& x)
{
  if (this->choice_arm_ != Block_tag)
    this->choice_arm (Block_tag);

  reinterpret_cast< ::BlockType& > (this->choice_.Block_) = x;
}

const ::GroupReferenceType& GroupType::choice_type::
GroupReference () const
{
  return reinterpret_cast< const ::GroupReferenceType& > (this->choice_.GroupReference_);
}

::GroupReferenceType& GroupType::choice_type::
GroupReference ()
{
  return reinterpret_cast< ::GroupReferenceType& > (this->choice_.GroupReference_);
}

void GroupType::choice_type::
GroupReference (const ::GroupReferenceType& x)
{
  if (this->choice_arm_ != GroupReference_tag)
    this->choice_arm (GroupReference_tag);

  reinterpret_cast< ::GroupReferenceType& > (this->choice_.GroupReference_) = x;
}

// SceneDescriptionType
//

const SceneDescriptionType::Group_sequence& SceneDescriptionType::
Group () const
{
  return this->Group_;
}

SceneDescriptionType::Group_sequence& SceneDescriptionType::
Group ()
{
  return this->Group_;
}

const ::BlockType& SceneDescriptionType::
Base () const
{
  return this->Base_;
}

::BlockType& SceneDescriptionType::
Base ()
{
  return this->Base_;
}

void SceneDescriptionType::
Base (const ::BlockType& x)
{
  this->Base_ = x;
}

const SceneDescriptionType::GroupReference_sequence& SceneDescriptionType::
GroupReference () const
{
  return this->GroupReference_;
}

SceneDescriptionType::GroupReference_sequence& SceneDescriptionType::
GroupReference ()
{
  return this->GroupReference_;
}

#include <stdlib.h>
#include <new>

// Vector
//

Vector::
Vector ()
{
}

Vector::
~Vector ()
{
}

Vector::
Vector (const Vector& x)
{
  XSDE_UNUSED (x);
  this->X_ = x.X_;
  this->Y_ = x.Y_;
  this->Z_ = x.Z_;
}

Vector& Vector::
operator= (const Vector& x)
{
  XSDE_UNUSED (x);
  this->X_ = x.X_;
  this->Y_ = x.Y_;
  this->Z_ = x.Z_;
  return *this;
}

// Color
//

Color::
Color ()
{
}

Color::
~Color ()
{
}

Color::
Color (const Color& x)
{
  XSDE_UNUSED (x);
  this->R_ = x.R_;
  this->G_ = x.G_;
  this->B_ = x.B_;
}

Color& Color::
operator= (const Color& x)
{
  XSDE_UNUSED (x);
  this->R_ = x.R_;
  this->G_ = x.G_;
  this->B_ = x.B_;
  return *this;
}

// BlockType
//

BlockType::
BlockType ()
{
  this->Color_present_ = false;
  this->Value_present_ = false;
}

BlockType::
~BlockType ()
{
}

BlockType::
BlockType (const BlockType& x)
{
  XSDE_UNUSED (x);
  this->Mass_ = x.Mass_;
  this->Size_ = x.Size_;
  this->Location_ = x.Location_;
  this->Color_present_ = x.Color_present_;
  if (this->Color_present_)
    this->Color_ = x.Color_;
  this->Value_present_ = x.Value_present_;
  if (this->Value_present_)
    this->Value_ = x.Value_;
}

BlockType& BlockType::
operator= (const BlockType& x)
{
  XSDE_UNUSED (x);
  this->Mass_ = x.Mass_;
  this->Size_ = x.Size_;
  this->Location_ = x.Location_;
  this->Color_present_ = x.Color_present_;
  if (this->Color_present_)
    this->Color_ = x.Color_;
  this->Value_present_ = x.Value_present_;
  if (this->Value_present_)
    this->Value_ = x.Value_;
  return *this;
}

// GroupReferenceType
//

GroupReferenceType::
GroupReferenceType ()
{
  this->Color_present_ = false;
}

GroupReferenceType::
~GroupReferenceType ()
{
}

GroupReferenceType::
GroupReferenceType (const GroupReferenceType& x)
{
  XSDE_UNUSED (x);
  this->Location_ = x.Location_;
  this->Color_present_ = x.Color_present_;
  if (this->Color_present_)
    this->Color_ = x.Color_;
  this->Ref_ = x.Ref_;
}

GroupReferenceType& GroupReferenceType::
operator= (const GroupReferenceType& x)
{
  XSDE_UNUSED (x);
  this->Location_ = x.Location_;
  this->Color_present_ = x.Color_present_;
  if (this->Color_present_)
    this->Color_ = x.Color_;
  this->Ref_ = x.Ref_;
  return *this;
}

// GroupType
//

GroupType::
GroupType ()
{
}

GroupType::
~GroupType ()
{
}

GroupType::choice_type::
choice_type ()
{
  this->choice_arm_ = choice_arm_tag (2);
}

GroupType::choice_type::
~choice_type ()
{
  this->choice_arm (choice_arm_tag (2));
}

GroupType::choice_type::
choice_type (const choice_type& x)
{
  this->choice_arm_ = x.choice_arm_;
  switch (this->choice_arm_)
  {
    case Block_tag:
    {
      new (&this->choice_.Block_) ::BlockType (reinterpret_cast< const ::BlockType& > (x.choice_.Block_));
      break;
    }
    case GroupReference_tag:
    {
      new (&this->choice_.GroupReference_) ::GroupReferenceType (reinterpret_cast< const ::GroupReferenceType& > (x.choice_.GroupReference_));
      break;
    }
    default:
    break;
  }
}

GroupType::choice_type& GroupType::choice_type::
operator= (const choice_type& x)
{
  this->choice_arm (x.choice_arm_);
  switch (this->choice_arm_)
  {
    case Block_tag:
    {
      reinterpret_cast< ::BlockType& > (this->choice_.Block_) = reinterpret_cast< const ::BlockType& > (x.choice_.Block_);
      break;
    }
    case GroupReference_tag:
    {
      reinterpret_cast< ::GroupReferenceType& > (this->choice_.GroupReference_) = reinterpret_cast< const ::GroupReferenceType& > (x.choice_.GroupReference_);
      break;
    }
    default:
    break;
  }

  return *this;
}

void GroupType::choice_type::
choice_arm (choice_arm_tag x)
{
  if (this->choice_arm_ == x)
    return;

  switch (this->choice_arm_)
  {
    case Block_tag:
    {
      typedef ::BlockType _dtor;
      reinterpret_cast< ::BlockType& > (this->choice_.Block_).~_dtor ();
      break;
    }
    case GroupReference_tag:
    {
      typedef ::GroupReferenceType _dtor;
      reinterpret_cast< ::GroupReferenceType& > (this->choice_.GroupReference_).~_dtor ();
      break;
    }
    default:
    break;
  }

  this->choice_arm_ = choice_arm_tag (2);

  switch (x)
  {
    case Block_tag:
    {
      new (&this->choice_.Block_) ::BlockType;
      break;
    }
    case GroupReference_tag:
    {
      new (&this->choice_.GroupReference_) ::GroupReferenceType;
      break;
    }
    default:
    break;
  }

  this->choice_arm_ = x;
}

// SceneDescriptionType
//

SceneDescriptionType::
SceneDescriptionType ()
{
}

SceneDescriptionType::
~SceneDescriptionType ()
{
}

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

#include <xsde/cxx/post.hxx>

