Revision: 44182 http://brlcad.svn.sourceforge.net/brlcad/?rev=44182&view=rev Author: erikgreenwald Date: 2011-04-04 14:45:12 +0000 (Mon, 04 Apr 2011)
Log Message: ----------- add GeometryBoTReqMsg Modified Paths: -------------- geomcore/trunk/src/libNet/CMakeLists.txt Added Paths: ----------- geomcore/trunk/include/GeometryBoTReqMsg.h geomcore/trunk/src/libNet/netMsg/GeometryBoTReqMsg.cxx Added: geomcore/trunk/include/GeometryBoTReqMsg.h =================================================================== --- geomcore/trunk/include/GeometryBoTReqMsg.h (rev 0) +++ geomcore/trunk/include/GeometryBoTReqMsg.h 2011-04-04 14:45:12 UTC (rev 44182) @@ -0,0 +1,78 @@ +/* G E O M E T R Y B O T R E Q M S G . H + * BRL-CAD + * + * Copyright (c) 2011 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ + +/** @file GeometryBoTReqMsg.h + * + * Request the geometry as BoTs, with exactly one BoT primitive per + * region. + */ + +#ifndef __GEOMETRYREQMSG_H__ +#define __GEOMETRYREQMSG_H__ + +#include "GenericOneStringMsg.h" + +class GeometryBoTReqMsg : public GenericOneStringMsg +{ + public: + + /* Only Constructor */ + GeometryBoTReqMsg(std::string path, bool recurse); + + /* Reply Constructor */ + GeometryBoTReqMsg(NetMsg* msg, std::string path, bool recurse); + + /* Deserializing Constructor */ + GeometryBoTReqMsg(DataStream* ds, Portal* origin); + + /* Destructor */ + virtual ~GeometryBoTReqMsg(); + + virtual std::string toString(); + + /* + *Getters n Setters + */ + bool getRecurse(); + + std::string getPath(); + + private: + bool recurse; + + bool _serialize(DataStream* ds); + bool _equals(const NetMsg& msg); + + /* Disable copy cstr and =operator */ + GeometryBoTReqMsg(GeometryBoTReqMsg const&):GenericOneStringMsg(0,""){}; + GeometryBoTReqMsg& operator=(GeometryBoTReqMsg const&){}; +}; + +#endif /* __GEOMETRYREQMSG_H__ */ + +/* + * Local Variables: *** + * mode: C + * tab-width: 8 + * c-basic-offset: 4 *** + * indent-tabs-mode: t + * End: *** + * ex: shiftwidth=4 tabstop=8 +*/ Property changes on: geomcore/trunk/include/GeometryBoTReqMsg.h ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Modified: geomcore/trunk/src/libNet/CMakeLists.txt =================================================================== --- geomcore/trunk/src/libNet/CMakeLists.txt 2011-04-04 14:27:26 UTC (rev 44181) +++ geomcore/trunk/src/libNet/CMakeLists.txt 2011-04-04 14:45:12 UTC (rev 44182) @@ -49,6 +49,7 @@ netMsg/SessionInfoMsg.cxx netMsg/NewNodeOnNetMsg.cxx netMsg/GeometryReqMsg.cxx + netMsg/GeometryBoTReqMsg.cxx netMsg/GeometryManifestMsg.cxx netMsg/GeometryChunkMsg.cxx netMsg/PingMsg.cxx @@ -97,6 +98,7 @@ SessionInfoMsg.h NewNodeOnNetMsg.h GeometryReqMsg.h + GeometryBoTReqMsg.h GeometryManifestMsg.h GeometryChunkMsg.h PingMsg.h Added: geomcore/trunk/src/libNet/netMsg/GeometryBoTReqMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/GeometryBoTReqMsg.cxx (rev 0) +++ geomcore/trunk/src/libNet/netMsg/GeometryBoTReqMsg.cxx 2011-04-04 14:45:12 UTC (rev 44182) @@ -0,0 +1,103 @@ +/* G E O M E T R Y B O T R E Q M S G . C X X + * BRL-CAD + * + * Copyright (c) 2011 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ + +/** @file GeometryBoTReqMsg.cxx + * + * Request geometry in BoT format, tesselating if required. Each region + * holds exactly 1 BoT primitive. + * + */ + +#include "NetMsgTypes.h" +#include "GeometryBoTReqMsg.h" + +/* Normal Constructor */ +GeometryBoTReqMsg::GeometryBoTReqMsg(std::string path, bool recurse) : + GenericOneStringMsg(GEOMETRYREQ, path), recurse(recurse) +{} + +/* Reply Constructor */ +GeometryBoTReqMsg::GeometryBoTReqMsg(NetMsg* msg, std::string path, bool recurse) : + GenericOneStringMsg(GEOMETRYREQ, msg, path), recurse(recurse) +{} + +/* Deserializing Constructor */ +GeometryBoTReqMsg::GeometryBoTReqMsg(DataStream* ds, Portal* origin) : + GenericOneStringMsg(ds, origin) +{ + recurse = *ds->get(1); +} + +/* Destructor */ +GeometryBoTReqMsg::~GeometryBoTReqMsg() +{} + +bool GeometryBoTReqMsg::_serialize(DataStream* ds) +{ + /* Call the super */ + GenericOneStringMsg::_serialize(ds); + + ds->append((const char *)&recurse, 1); + return true; +} + +std::string GeometryBoTReqMsg::toString() +{ + char out[BUFSIZ]; + + snprintf(out, BUFSIZ, "%s' recurse: '%d'", GenericOneStringMsg::toString().c_str(), this->recurse); + + return std::string(out); +} + +bool GeometryBoTReqMsg::_equals(const NetMsg& msg) +{ + GeometryBoTReqMsg& gmsg = (GeometryBoTReqMsg&) msg; + + if (this->getRecurse() != gmsg.getRecurse()) { + return false; + } + + return true; +} + +/* + *Getters n Setters + */ +bool GeometryBoTReqMsg::getRecurse() +{ + return this->recurse; +} + +std::string +GeometryBoTReqMsg::getPath() +{ + return this->strData; +} + +/* + * Local Variables: + * mode: C + * tab-width: 8 + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Property changes on: geomcore/trunk/src/libNet/netMsg/GeometryBoTReqMsg.cxx ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits