/**************************************************************************** Copyright (c) 2010,Radon Labs GmbH Copyright (c) 2011-2013,WebJet Business Division,CYOU http://www.genesis-3d.com.cn Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #ifndef __visserver_H__ #define __visserver_H__ #include "core/refcounted.h" #include "vis/visentity.h" #include "vis/vissystems/vissystembase.h" #include "vis/visquery.h" #include "vis/visentity.h" #include "core/singleton.h" //------------------------------------------------------------------------------ namespace Vis { class VisServer : public Core::RefCounted { __DeclareClass(VisServer); public: /// constructor VisServer(); /// destructor virtual ~VisServer(); /// open void Open(); /// close void Close(); /** * AttachVisSystem add a visible system. * @param: const GPtr & system * @return: void * @see: * @remark: */ void AttachVisSystem(const GPtr& system); /** * AttachVisSystems add a visible system array. * @param: const Util::Array > & systems * @return: void * @see: * @remark: */ void AttachVisSystems(const Util::Array >& systems); /** * RemoveVisSystem remove a visible system. * @param: const GPtr & system * @return: void * @see: * @remark: */ void RemoveVisSystem(const GPtr& system); /** * GetVisSystems get the visible system array. * @param: void * @return: const Util::Array >& * @see: * @remark: */ const Util::Array >& GetVisSystems(void); /** * RegisterVisEntity * @param: const GPtr & entity * @param: IndexT VisibilitySystemIndex * @return: void * @see: * @remark: */ void RegisterVisEntity(const GPtr& entity, IndexT VisibilitySystemIndex = InvalidIndex ); /** * UnregisterVisEntity * @param: const GPtr & entity * @param: IndexT VisibilitySystemIndex InvalidIndex means all visible system. * @return: void * @see: * @remark: */ void UnregisterVisEntity(const GPtr& entity, IndexT VisibilitySystemIndex = InvalidIndex ); /** * UpdateVisEntity * @param: const GPtr & entity * @return: void * @see: * @remark: */ void UpdateVisEntity(const GPtr& entity); /** * PerformVisQuery * @param: const GPtr & observer * @param: const Util::Array & systemIndex InvalidIndex means all visible system. * @return: GPtr * @see: * @remark: */ GPtr PerformVisQuery(const GPtr& observer , const Util::Array& systemIndex ); /** * PerformVisQuery * @param: const Util::Array< GPtr > & observers * @param: const Util::Array & systemIndex * @param: Util::Array< GPtr >& results * @return: void * @see: * @remark: */ void PerformVisQuery( const Util::Array< GPtr >& observers , const Util::Array& systemIndex, Util::Array< GPtr >& results ); /// on render debug void OnRenderDebug(); protected: GPtr CreateVisQuery(const GPtr& observer , const Util::Array& systemIndex ); private: bool mIsOpen; Util::Array > mVisibilitySystems; }; } // namespace Vis //------------------------------------------------------------------------------ #endif // __visserver_H__