Rhino C++ API  8.6
Public Types | Public Member Functions | List of all members
ON_ArithmeticCalculator Class Reference

#include <opennurbs_parse.h>

Public Types

enum  ERROR_CONDITION {
  no_error = 0, program_error = 1, invalid_expression_error = 2, divide_by_zero_error = 3,
  overflow_error = 4
}
 

Public Member Functions

 ON_ArithmeticCalculator ()
 
 ON_ArithmeticCalculator (const ON_ArithmeticCalculator &)
 
 ON_ArithmeticCalculator (ON_ArithmeticCalculator &&)
 
bool Add ()
 
void ClearAll ()
 
bool Divide ()
 
ERROR_CONDITION ErrorCondition () const
 
bool Evaluate (double *value)
 
bool ImpliedMultiplication () const
 
bool LeftParenthesis ()
 
bool Multiply ()
 
bool Number (double x)
 
ON_ArithmeticCalculatoroperator= (const ON_ArithmeticCalculator &)
 
ON_ArithmeticCalculatoroperator= (ON_ArithmeticCalculator &&)
 
unsigned int ParenthesesDepth () const
 
bool PendingImpliedMultiplication () const
 
bool PendingUnaryMinus () const
 
bool PendingUnaryOperation () const
 
bool PendingUnaryPlus () const
 
bool RightParenthesis ()
 
void SetImpliedMultiplication (bool bEnable)
 
bool SimpleNumber (double x)
 
bool Subtract ()
 
bool UnaryMinus ()
 
bool UnaryPlus ()
 

Detailed Description

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org.

Member Enumeration Documentation

◆ ERROR_CONDITION

Current Status

Enumerator
no_error 
program_error 
invalid_expression_error 

The part of the computer running the ON_ArithmeticCalculator code is corrupt or damaged or there is a bug in the ON_ArithmeticCalculator code.

divide_by_zero_error 

The input expression does not make sense.

overflow_error 

A calculation requested division by zero.

Constructor & Destructor Documentation

◆ ON_ArithmeticCalculator() [1/3]

ON_ArithmeticCalculator::ON_ArithmeticCalculator ( )

◆ ON_ArithmeticCalculator() [2/3]

ON_ArithmeticCalculator::ON_ArithmeticCalculator ( const ON_ArithmeticCalculator )

◆ ON_ArithmeticCalculator() [3/3]

ON_ArithmeticCalculator::ON_ArithmeticCalculator ( ON_ArithmeticCalculator &&  )

Member Function Documentation

◆ Add()

bool ON_ArithmeticCalculator::Add ( )

Description: Enter an explicit addition operator whose operands are the previous value and the next value, where a value is a number, simple number, or parenthetic expression.

◆ ClearAll()

void ON_ArithmeticCalculator::ClearAll ( )

Description: Clear all status, values and expressions.

◆ Divide()

bool ON_ArithmeticCalculator::Divide ( )

Description: Enter an explicit division operator whose operands are the previous value and the next value, where a value is a number, simple number, or parenthetic expression. If the second value is zero, the calculator state is set to error.

◆ ErrorCondition()

ERROR_CONDITION ON_ArithmeticCalculator::ErrorCondition ( ) const

◆ Evaluate()

bool ON_ArithmeticCalculator::Evaluate ( double *  value)

Description: Calculate the current value.

◆ ImpliedMultiplication()

bool ON_ArithmeticCalculator::ImpliedMultiplication ( ) const

Configuration Settings

◆ LeftParenthesis()

bool ON_ArithmeticCalculator::LeftParenthesis ( )

Description: Begin a parenthetic expression.

◆ Multiply()

bool ON_ArithmeticCalculator::Multiply ( )

Description: Enter an explicit multiplication operator whose operands are the previous value and the next value, where a value is a number, simple number, or parenthetic expression.

◆ Number()

bool ON_ArithmeticCalculator::Number ( double  x)

Calculator keys Description: Enter a number that can be used as an implied multiplication operand when implied multiplication is enabled and appropriate.

◆ operator=() [1/2]

ON_ArithmeticCalculator& ON_ArithmeticCalculator::operator= ( const ON_ArithmeticCalculator )

◆ operator=() [2/2]

ON_ArithmeticCalculator& ON_ArithmeticCalculator::operator= ( ON_ArithmeticCalculator &&  )

◆ ParenthesesDepth()

unsigned int ON_ArithmeticCalculator::ParenthesesDepth ( ) const

Returns: The current number of parenthetic expressions that are not completed.

◆ PendingImpliedMultiplication()

bool ON_ArithmeticCalculator::PendingImpliedMultiplication ( ) const

Returns: True if an implied multiplication will be applied to the next number or parenthetical expression.

◆ PendingUnaryMinus()

bool ON_ArithmeticCalculator::PendingUnaryMinus ( ) const

Returns: True if a unary minus is pending and will be applied to the next number or parenthetical expression.

◆ PendingUnaryOperation()

bool ON_ArithmeticCalculator::PendingUnaryOperation ( ) const

Returns: True if a unary plus or unary minus is pending

◆ PendingUnaryPlus()

bool ON_ArithmeticCalculator::PendingUnaryPlus ( ) const

Returns: True if a unary plus is pending and will be applied to the next number or parenthetical expression.

◆ RightParenthesis()

bool ON_ArithmeticCalculator::RightParenthesis ( )

Description: End a parenthetic expression.

◆ SetImpliedMultiplication()

void ON_ArithmeticCalculator::SetImpliedMultiplication ( bool  bEnable)

◆ SimpleNumber()

bool ON_ArithmeticCalculator::SimpleNumber ( double  x)

Description: Enter a number that will never use implied multiplication.

◆ Subtract()

bool ON_ArithmeticCalculator::Subtract ( )

Description: Enter an explicit subtraction operator whose operands are the previous value and the next value, where a value is a number, simple number, or parenthetic expression.

◆ UnaryMinus()

bool ON_ArithmeticCalculator::UnaryMinus ( )

Description: Enter an unary minus operator whose operand is the next number, simple number, or parenthetic expression.

◆ UnaryPlus()

bool ON_ArithmeticCalculator::UnaryPlus ( )

Description: Enter an unary plus operator whose operand is the next number, simple number, or parenthetic expression.