new_apphot


The new_apphot function is a non-class version of the CApphot:new method which creates and returns a new CApphot object.

Syntax

A = new_apphot()

bullet.gif    Default constructor. The new CApphot A has all properties set to default values.

A = new_apphot( CApphot_old )

bullet.gif    This is a copy constructor. The new CApphot A is initialized to the properties of CApphot_old. In place of CApphot and CApphot_old, use the actual name of the objects, such as A and A2.

Example

The following example shows the default constructor and destructor pair:

A = new_apphot()

-- create a new instance of A of the CApphot class.

  ...

-- other uses of the class go here, between new and delete.

A:delete()

-- deletes the object and its associated memory.

 

The next example shows the use of both constructors:

A = new_apphot(A1)

-- copy constructor, duplicates the data in A1

B = new_apphot()

-- default constructor

B.nRadius1 = 4.5

-- Set the value of nRadius1

B.nRadius2 = 12

-- Set the value of nRadius2

B.nRadius3 = 16

-- Set the value of nRadius3

bSuccess = B:Measure(I,x,y)

-- Measure object at (x,y) in CImage I

Printf("Mag = %lg", B.nMag )

-- result: Mag = 15.256

Related Topics

CApphot, Copy, new, delete


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.