📄 part.cpp
字号:
// ___ ___ ___ ___ ___ // /\__\ ___ /\__\ /\ \ /\__\ /\ \. // /::| | /\ \ /::| | /::\ \ /:/ / /::\ \. // /:|:| | \:\ \ /:|:| | /:/\:\ \ /:/ / /:/\:\ \. // /:/|:|__|__ /::\__\ /:/|:| |__ /:/ \:\ \ /:/ / /::\~\:\ \.// /:/ |::::\__\ __/:/\/__/ /:/ |:| /\__\ /:/__/_\:\__\ /:/__/ /:/\:\ \:\__\.// \/__/~~/:/ / /\/:/ / \/__|:|/:/ / \:\ /\ \/__/ \:\ \ \:\~\:\ \/__/// /:/ / \::/__/ |:/:/ / \:\ \:\__\ \:\ \ \:\ \:\__\. // /:/ / \:\__\ |::/ / \:\/:/ / \:\ \ \:\ \/__/ // /:/ / \/__/ /:/ / \::/ / \:\__\ \:\__\. // \/__/ \/__/ \/__/ \/__/ \/__/ // // =============================================================================// Minimalist OpenGL Environment// Parallel Rendering Extension// =============================================================================//// Copyright 2007 Balazs Domonkos// // This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License// as published by the Free Software Foundation; either version 2// of the License, or (at your option) any later version.// // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA./// @file Part.cpp/// ParaComp generic window proxy#include <paracomp/include/Part.h>#include <math.h>#if MINGLE_PARACOMP_SUPPORT == 1namespace MinGLE {//const double ParaCompPart::DEFAULT_BOUNDING_BOX_OFFSET[3] = {0.0, 0.0, 0.0};//const double ParaCompPart::INVALID_BOUNDING_BOX_SIZE[3] = {0.0, 0.0, 0.0};#define PCCHECKERROR(method, err) if(err!=PC_NO_ERROR) Except(method, pcGetErrorString(err))ParaCompPart::ParaCompPart(Window *window, ParaCompSupport *support, ParallelRenderingSupport::CompositingOperator compositingOperator) : ParallelRenderingWindowProxy(window, compositingOperator), mSupport(support), mContext(0) //mBoundingBoxIsInvalid(true), { // Initialize bounding box //mBoundingBoxOffset[0] = DEFAULT_BOUNDING_BOX_OFFSET[0], mBoundingBoxOffset[1] = DEFAULT_BOUNDING_BOX_OFFSET[1], mBoundingBoxOffset[2] = DEFAULT_BOUNDING_BOX_OFFSET[2]; //mBoundingBoxSize[0] = INVALID_BOUNDING_BOX_SIZE[0], mBoundingBoxSize[1] = INVALID_BOUNDING_BOX_SIZE[1], mBoundingBoxSize[2] = INVALID_BOUNDING_BOX_SIZE[2]; // Initialize center //_calculateBoundingBoxCenter(); //mBoundingBoxCenter[3] = 1.0; }ParaCompPart::~ParaCompPart() { if(mContext) destroyContext(); if(mFrameProcessor) delete mFrameProcessor;}void ParaCompPart::setSortOrder(unsigned order) { mFrameProcessor->setSortOrder((PCuint) order);}void ParaCompPart::destroyContext() { Assert(mContext, "ParaCompPart::destroyContext"); // Destroy the context. // Note that this is an implicit sync. All hosts not exit // this call until all hosts have made this call. { PCerr err = pcContextDestroy(mContext); PCCHECKERROR("ParaCompPart::destroyContext", err); }}void ParaCompPart::_refreshContextInfo() { // Determine our host index pcContextGetInteger(mContext, PC_HOSTINDEX, PC_LOCALHOST_INDEX, &mThisRenderer); // And the total number of hosts pcContextGetInteger(mContext, PC_NUM_HOSTS, 0, &mRendererCount);}void ParaCompPart::_createFrameProcessor() { // TODO a parameter should decide what kind if frame processor to create //mFrameProcessor = new FrameProcessor(mContext, mCompositingOperator==ParallelRenderingSupport::ALPHA_BLEND_OPERATOR); mFrameProcessor = new FrameProcessorHP(mContext, mCompositingOperator==ParallelRenderingSupport::ALPHA_BLEND_OPERATOR);}/*void ParaCompPart::_calculateBoundingBoxCenter() { mBoundingBoxCenter[0] = mBoundingBoxOffset[0] + 0.5 * mBoundingBoxSize[0]; mBoundingBoxCenter[1] = mBoundingBoxOffset[1] + 0.5 * mBoundingBoxSize[1]; mBoundingBoxCenter[2] = mBoundingBoxOffset[2] + 0.5 * mBoundingBoxSize[2];}*/#undef PCCHECKERROR} // namespace MinGLE#endif // MINGLE_PARACOMP_SUPPORT == 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -