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