Blender V2.61 - r43446

Operator2Expr.h

Go to the documentation of this file.
00001 /*
00002  * Operator2Expr.h: interface for the COperator2Expr class.
00003  * Copyright (c) 1996-2000 Erwin Coumans <coockie@acm.org>
00004  *
00005  * Permission to use, copy, modify, distribute and sell this software
00006  * and its documentation for any purpose is hereby granted without fee,
00007  * provided that the above copyright notice appear in all copies and
00008  * that both that copyright notice and this permission notice appear
00009  * in supporting documentation.  Erwin Coumans makes no
00010  * representations about the suitability of this software for any
00011  * purpose.  It is provided "as is" without express or implied warranty.
00012  *
00013  */
00014 
00019 #if !defined _OPERATOR2EXPR_H
00020 #define _OPERATOR2EXPR_H
00021 
00022 
00023 #include "Expression.h"
00024 #include "Value.h"  // Added by ClassView
00025 
00026 class COperator2Expr : public CExpression  
00027 {
00028     //PLUGIN_DECLARE_SERIAL_EXPRESSION (COperator2Expr,CExpression)
00029 
00030 public:
00031     virtual bool MergeExpression(CExpression* otherexpr);
00032     virtual unsigned char GetExpressionID() { return COPERATOR2EXPRESSIONID;};
00033     virtual void BroadcastOperators(VALUE_OPERATOR op);
00034     CExpression* CheckLink(std::vector<CBrokenLinkInfo*>& brokenlinks);
00035     //virtual bool IsInside(float x,float y,float z,bool bBorderInclude=true);
00036     //virtual bool IsLeftInside(float x,float y,float z,bool bBorderInclude);
00037     //virtual bool IsRightInside(float x,float y,float z,bool bBorderInclude);
00038     bool NeedsRecalculated();
00039     void    ClearModified() { 
00040         if (m_lhs)
00041             m_lhs->ClearModified();
00042         if (m_rhs)
00043             m_rhs->ClearModified();
00044     }
00045     virtual CValue* Calculate();
00046     COperator2Expr(VALUE_OPERATOR op, CExpression *lhs, CExpression *rhs);
00047     COperator2Expr();
00048     virtual ~COperator2Expr();
00049 
00050     
00051 protected:
00052     CExpression * m_rhs;
00053     CExpression * m_lhs;
00054     CValue* m_cached_calculate; // cached result
00055     
00056 private:
00057     VALUE_OPERATOR m_op;
00058 
00059 
00060 #ifdef WITH_CXX_GUARDEDALLOC
00061 public:
00062     void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator2Expr"); }
00063     void operator delete( void *mem ) { MEM_freeN(mem); }
00064 #endif
00065 };
00066 
00067 #endif // !defined _OPERATOR2EXPR_H
00068