⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 part.h

📁 光滑质点无网格法SPH并行计算程序
💻 H
字号:
//      ___                       ___           ___           ___       ___     //     /\__\          ___        /\__\         /\  \         /\__\     /\  \.   //    /::|  |        /\  \      /::|  |       /::\  \       /:/  /    /::\  \.  //   /:|:|  |        \:\  \    /:|:|  |      /:/\:\  \     /:/  /    /:/\:\  \. //  /:/|:|__|__      /::\__\  /:/|:|  |__   /:/  \:\  \   /:/  /    /::\~\:\  \.// /:/ |::::\__\  __/:/\/__/ /:/ |:| /\__\ /:/__/_\:\__\ /:/__/    /:/\:\ \:\__\.// \/__/~~/:/  / /\/:/  /    \/__|:|/:/  / \:\  /\ \/__/ \:\  \    \:\~\:\ \/__///       /:/  /  \::/__/         |:/:/  /   \:\ \:\__\    \:\  \    \:\ \:\__\. //      /:/  /    \:\__\         |::/  /     \:\/:/  /     \:\  \    \:\ \/__/  //     /:/  /      \/__/         /:/  /       \::/  /       \:\__\    \:\__\.   //     \/__/                     \/__/         \/__/         \/__/     \/__/    // // =============================================================================//                       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.h/// ParaComp generic window proxy#ifndef __MINGLE_PARALLEL_PARACOMP_PART_H__#define __MINGLE_PARALLEL_PARACOMP_PART_H__// Include class definitions#include <parallel-classes.h>#include <paracomp/include/FrameProcessor.h>#include <EventTransmission.h>#include <ParallelRenderingWindowProxy.h>#include <pcapi.h>#if MINGLE_PARACOMP_SUPPORT == 1namespace MinGLE {	// Class predefinition	class ParaCompSupport;	class ParaCompPart : public ParallelRenderingWindowProxy {			//static const double DEFAULT_BOUNDING_BOX_OFFSET[3];			//static const double INVALID_BOUNDING_BOX_SIZE[3];		protected:			ParaCompSupport *mSupport;			PCcontext mContext;						FrameProcessor *mFrameProcessor;					// Framelet size calculation			//double mBoundingBoxIsInvalid;			//double mBoundingBoxOffset[3], mBoundingBoxSize[3];					// Sort order calculation			//double mBoundingBoxCenter[4];				    public:	    	ParaCompPart(Window *window, ParaCompSupport *support,  ParallelRenderingSupport::CompositingOperator compositingOperator);	    	~ParaCompPart();	    	/*inline virtual void setBoundingBox(const double *offset, const double *size) {				// Set bounding box and make it valid enabling automatic framlet and sort order calculations	    		mBoundingBoxOffset[0] = offset[0], mBoundingBoxOffset[1] = offset[1], mBoundingBoxOffset[2] = offset[2]; 	    		mBoundingBoxSize[0] = size[0], mBoundingBoxSize[1] = size[1], mBoundingBoxSize[2] = size[2];	    		mBoundingBoxIsInvalid = false;	    			    		// Calculate the center of the bounding box needed by sort order calculation	    		_calculateBoundingBoxCenter(); 	    	}*/	    		    	virtual void createContext() = 0;	    	virtual void destroyContext();	    	virtual void setSortOrder(unsigned order);	    		    	/// Contributing pixels and retrieving output	    	inline void pixelTransfer() {	    		// Contribute pixels	    		if(mContributePixels) {	    				    			// Calculate framelet sizes and offsets if needed	    			if(mAutoCalculateFramelet) _calculateFramelet();	    				    			// If the framelet is valid contribute pixels	    			if(mValidFramelet) {		    			// Calculate sort order if needed		    			if(mAutoCalculateSortOrder && ParallelRenderingSupport::needSorting(mCompositingOperator)) _calculateSortOrder();	    	    			    	    		// Note render method is only called when it is needed		    			// Note when automatic framelet or sort order calculation is turned off		    			// one probably wants to calculate these information during the		    			// rendering method.	    				_doRender();	    				// Indicate the start of a new frame	    	    		mFrameProcessor->beginFrame(mBoundingRectangleOffset[0], mBoundingRectangleOffset[1], mBoundingRectangleSize[0], mBoundingRectangleSize[1]);	    					    				// Display bounding box if needed	    				if(mDisplayDebug & ParallelRenderingSupport::DISPLAY_BOUNDING_BOX) 	    					_displayBoundingBox(mDisplayDebug & ParallelRenderingSupport::DISPLAY_FILL);	    	    			    				// Display bounding rectangle if needed	    				if(mDisplayDebug & ParallelRenderingSupport::DISPLAY_BOUNDING_RECT) 	    					_displayBoundingRectangle(mDisplayDebug & ParallelRenderingSupport::DISPLAY_FILL);	    				// Add image date	    				mFrameProcessor->addFrame();	    			}	    				    			// Otherwise, skip the contribution stage	    			else {	        			mFrameProcessor->skipFrame();	    			}	    		}	    			    		// Skip contribution stage	    		else {        			mFrameProcessor->skipFrame();	    		}	    			    		// Close contribution stage        		mFrameProcessor->endFrame();				        		// Retrieve output        		if(mDisplayOutput)        			mFrameProcessor->displayOutput(0, 0, mWindow->getWidth(), mWindow->getHeight());	    	}	    			protected:			virtual void _refreshContextInfo();			virtual void _createFrameProcessor();			//virtual void _calculateBoundingBoxCenter();						/*virtual inline void _saveOpenGLMatrices() {   				glMatrixMode(GL_MODELVIEW); glPushMatrix();   				glMatrixMode(GL_PROJECTION); glPushMatrix();			}			virtual inline void _restoreOpenGLMatrices() {   				glMatrixMode(GL_MODELVIEW); glPopMatrix();   				glMatrixMode(GL_PROJECTION); glPopMatrix();			}*/	};}#endif // MINGLE_PARACOMP_SUPPORT == 1#endif // __MINGLE_PARALLEL_PARACOMP_PART_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -