#include "ZGo.h"



//---- ZGoTransform ----------------------------------------------------------//

//---- ZGoTransform

ZGoTransform::ZGoTransform(ZGo *zgo, ZGoPARAMS *input, ZGoPARAMS *output)
{
  this->zgo = zgo;
  this->input = input->setInput(this);
  this->output = output->setOutput(this);

  this->fnType = new ZGoNAME(zgo, "ZGoTransform");

  //  Parameters

  m = (ZGoMATRIX *)input->get("matrix");
  obj = (ZGo3DOBJECT *)input->get("object");
  result = (ZGo3DOBJECT *)output->get("result");
}



//---- process

void ZGoTransform::process()
{
  m->process();
  obj->process();

  //- Combine trnasformations

  m->transform(obj->trans, result->trans);

  //- Move points from obj to result

  result->points = obj->points;
  result->point = obj->point;

  //- Move faces

  result->faces = obj->faces;
  result->face  = obj->face;

  //- Move sub-objects

  result->objects = obj->objects;
  result->object  = obj->object;
}



//---- end of file -----------------------------------------------------------//
