OCC Main Page | Visualization | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

Visualization
TKV3d
Graphic3d


Graphic3d_ArrayOfPrimitives Class Reference

This class furnish services to defined and fill an
array of primitives compatible with the use of
the OPENGl glDrawArrays() or glDrawElements() functions.
NOTE that the main goal of this kind of primitive
is to avoid multiple copies of datas between
each layer of the software.
So the array datas exist only one time and the use
of SetXxxxxx() methods enable to change dynamically
the aspect of this primitive.
.

#include <Graphic3d_ArrayOfPrimitives.hxx>

Inheritance diagram for Graphic3d_ArrayOfPrimitives:

Inheritance graph
[legend]

Public Member Functions

Standard_EXPORT void Destroy ()
 ~Graphic3d_ArrayOfPrimitives ()
Standard_EXPORT Standard_Integer AddVertex (const gp_Pnt &aVertice)
 Adds a vertice in the array.
returns the actual vertex number.
.
Standard_EXPORT Standard_Integer AddVertex (const Standard_Real X, const Standard_Real Y, const Standard_Real Z)
 Adds a vertice in the array.
returns the actual vertex number.
.
Standard_EXPORT Standard_Integer AddVertex (const gp_Pnt &aVertice, const Quantity_Color &aColor)
 Adds a vertice and vertex color in the vertex array.
returns the actual vertex number.
Warning: <acolor> is ignored when the <hasvcolors>
constructor parameter is FALSE
.
Standard_EXPORT Standard_Integer AddVertex (const gp_Pnt &aVertice, const gp_Dir &aNormal)
 Adds a vertice and vertex normal in the vertex array.
returns the actual vertex number.
Warning: <anormal> is ignored when the <hasvnormals>
constructor parameter is FALSE.
.
Standard_EXPORT Standard_Integer AddVertex (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ)
 Adds a vertice and vertex normal in the vertex array.
returns the actual vertex number.
Warning: <anormal> is ignored when the <hasvnormals>
constructor parameter is FALSE.
.
Standard_EXPORT Standard_Integer AddVertex (const gp_Pnt &aVertice, const gp_Dir &aNormal, const Quantity_Color &aColor)
 Adds a vertice,vertex normal and color in the vertex array.
returns the actual vertex number.
Warning: <anormal> is ignored when the <hasvnormals>
constructor parameter is FALSE.
<acolor> is ignored when the <hasvcolors>
constructor parameter is FALSE
.
Standard_EXPORT Standard_Integer AddVertex (const gp_Pnt &aVertice, const gp_Pnt2d &aTexel)
 Adds a vertice and vertex texture in the vertex array.
returns the actual vertex number.
<atexel> is ignored when the <hasvtexels>
constructor parameter is FALSE.
.
Standard_EXPORT Standard_Integer AddVertex (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real TX, const Standard_Real TY)
 Adds a vertice and vertex texture coordinates in the vertex array.
returns the actual vertex number.
<atexel> is ignored when the <hasvtexels>
constructor parameter is FALSE.
.
Standard_EXPORT Standard_Integer AddVertex (const gp_Pnt &aVertice, const gp_Dir &aNormal, const gp_Pnt2d &aTexel)
 Adds a vertice,vertex normal and texture in the vertex array.
returns the actual vertex number.
Warning: <anormal> is ignored when the <hasvnormals>
constructor parameter is FALSE.
<atexel> is ignored when the <hasvtexels>
constructor parameter is FALSE.
.
Standard_EXPORT Standard_Integer AddVertex (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ, const Standard_Real TX, const Standard_Real TY)
 Adds a vertice,vertex normal and texture in the vertex array.
returns the actual vertex number.
Warning: <anormal> is ignored when the <hasvnormals>
constructor parameter is FALSE.
<atexel> is ignored when the <hasvtexels>
constructor parameter is FALSE.
.
Standard_EXPORT Standard_Integer AddBound (const Standard_Integer edgeNumber)
 Adds a bound of length <edgenumber> in the bound array
returns the actual bounds number.
.
Standard_EXPORT Standard_Integer AddBound (const Standard_Integer edgeNumber, const Quantity_Color &aBColor)
 Adds a bound of length <edgenumber> and bound color
<abcolor> in the bound array.
returns the actual bounds number.
Warning: <abcolor> is ignored when the <hasbcolors>
constructor parameter is FALSE
.
Standard_EXPORT Standard_Integer AddBound (const Standard_Integer edgeNumber, const Standard_Real R, const Standard_Real G, const Standard_Real B)
 Adds a bound of length <edgenumber> and bound color
coordinates in the bound array.
returns the actual bounds number.
Warning: <R,G,B> are ignored when the <hasbcolors>
constructor parameter is FALSE
.
Standard_EXPORT Standard_Integer AddEdge (const Standard_Integer vertexIndex, const Standard_Boolean isVisible=Standard_True)
 Adds an edge in the range [1,VertexNumber()] in the array,
if <isvisible> is FALSE the edge between <vertexindex> and
the next edge will not be visible even if the SetEdgeOn() method
is activated in Graphic3d_AspectFillArea3d class.
returns the actual edges number.
Warning: <isvisible> is ignored when the <hasedgeinfos>
constructor parameter is FALSE.
.
Standard_EXPORT Standard_Boolean Orientate (const gp_Dir &aNormal)
 Orientate correctly all vertexs & normals of this array
according to the <anormal> parameter and
returns TRUE when something has change in the array.
Warning: When the array has edges this method is apply
on edge sub array instead on vertex sub array.
.
Standard_EXPORT Standard_Boolean Orientate (const Standard_Integer aBoundIndex, const gp_Dir &aNormal)
 Orientate correctly all vertexs & normal of the bound <abound>
according to the <anormal> parameter and
returns TRUE when something has change in the array.
Warning: When the array has edges this method is apply
on edge sub array instead on vertex sub array.
When this array has no bound, <aboundindex> design the item number
.
Standard_EXPORT void SetVertice (const Standard_Integer anIndex, const gp_Pnt &aVertice)
 Change the vertice of rank <anindex> in the array.
.
void SetVertice (const Standard_Integer anIndex, const Standard_Real X, const Standard_Real Y, const Standard_Real Z)
 Change the vertice of rank <anindex> in the array.
.
Standard_EXPORT void SetVertexColor (const Standard_Integer anIndex, const Quantity_Color &aColor)
 Change the vertex color of rank <anindex> in the array.
.
void SetVertexColor (const Standard_Integer anIndex, const Standard_Real R, const Standard_Real G, const Standard_Real B)
 Change the vertex color of rank <anindex> in the array.
.
Standard_EXPORT void SetVertexNormal (const Standard_Integer anIndex, const gp_Dir &aNormal)
 Change the vertex normal of rank <anindex> in the array.
.
void SetVertexNormal (const Standard_Integer anIndex, const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ)
 Change the vertex normal of rank <anindex> in the array.
.
Standard_EXPORT void SetVertexTexel (const Standard_Integer anIndex, const gp_Pnt2d &aTexel)
 Change the vertex texel of rank <anindex> in the array.
.
void SetVertexTexel (const Standard_Integer anIndex, const Standard_Real TX, const Standard_Real TY)
 Change the vertex texel of rank <anindex> in the array.
.
Standard_EXPORT void SetBoundColor (const Standard_Integer anIndex, const Quantity_Color &aColor)
 Change the bound color of rank <anindex> in the array.
.
void SetBoundColor (const Standard_Integer anIndex, const Standard_Real R, const Standard_Real G, const Standard_Real B)
 Change the bound color of rank <anindex> in the array.
.
Graphic3d_PrimitiveArray Array () const
 Returns the array address.
.
Graphic3d_TypeOfPrimitiveArray Type () const
 Returns the type of this primitive
.
Standard_EXPORT Standard_CString StringType () const
 Returns the string type of this primitive
.
Standard_Boolean HasVertexNormals () const
 Returns TRUE when vertex normals array is defined.
.
Standard_Boolean HasVertexColors () const
 Returns TRUE when vertex colors array is defined.
.
Standard_Boolean HasVertexTexels () const
 Returns TRUE when vertex texels array is defined.
.
Standard_Integer VertexNumber () const
 Returns the number of defined vertex
.
Standard_EXPORT gp_Pnt Vertice (const Standard_Integer aRank) const
 Returns the vertice at rank <arank>
from the vertex table if defined.
.
void Vertice (const Standard_Integer aRank, Standard_Real &X, Standard_Real &Y, Standard_Real &Z) const
 Returns the vertice coordinates at rank <arank>
from the vertex table if defined.
.
Standard_EXPORT Quantity_Color VertexColor (const Standard_Integer aRank) const
 Returns the vertex color at rank <arank>
from the vertex table if defined.
.
void VertexColor (const Standard_Integer aRank, Standard_Real &R, Standard_Real &G, Standard_Real &B) const
 Returns the vertex color values at rank <arank>
from the vertex table if defined.
.
Standard_EXPORT gp_Dir VertexNormal (const Standard_Integer aRank) const
 Returns the vertex normal at rank <arank>
from the vertex table if defined.
.
void VertexNormal (const Standard_Integer aRank, Standard_Real &NX, Standard_Real &NY, Standard_Real &NZ) const
 Returns the vertex normal coordinates at rank <arank>
from the vertex table if defined.
.
Standard_EXPORT gp_Pnt2d VertexTexel (const Standard_Integer aRank) const
 Returns the vertex texture at rank <arank>
from the vertex table if defined.
.
void VertexTexel (const Standard_Integer aRank, Standard_Real &TX, Standard_Real &TY) const
 Returns the vertex texture coordinates at rank <arank>
from the vertex table if defined.
.
Standard_Boolean HasEdgeInfos () const
 Returns TRUE when edge visibillity array is defined.
.
Standard_Integer EdgeNumber () const
 Returns the number of defined edges
.
Standard_Integer Edge (const Standard_Integer aRank) const
 Returns the vertex index at rank <arank>
in the range [1,VertexNumber()]
.
Standard_Boolean EdgeIsVisible (const Standard_Integer aRank) const
 Returns TRUE when the edge at rank <arank>
is visible.
.
Standard_Boolean HasBoundColors () const
 Returns TRUE when bound colors array is defined.
.
Standard_Integer BoundNumber () const
 Returns the number of defined bounds
.
Standard_Integer Bound (const Standard_Integer aRank) const
 Returns the edge number at rank <arank>.
.
Standard_EXPORT Quantity_Color BoundColor (const Standard_Integer aRank) const
 Returns the bound color at rank <arank>
from the bound table if defined.
.
Standard_EXPORT void BoundColor (const Standard_Integer aRank, Standard_Real &R, Standard_Real &G, Standard_Real &B) const
 Returns the bound color values at rank <arank>
from the bound table if defined.
.
Standard_EXPORT Standard_Integer ItemNumber () const
 Returns the number of total items according to
the array type.
.
Standard_EXPORT Standard_Boolean IsValid ()
 Returns TRUE only when the contains of this array is
available.
.
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const

Static Public Member Functions

static Standard_EXPORT void Enable ()
 Enable to use the arrays of primitives
Warning: Updates the current value of the environment symbol
CSF_USE_ARRAY_OF_PRIMITIVES
.
static Standard_EXPORT void Disable ()
 Disable to use the arrays of primitives
Warning: Updates the current value of the environment symbol
CSF_USE_ARRAY_OF_PRIMITIVES
.
static Standard_EXPORT Standard_Boolean IsEnable ()
 Returns TRUE when the arrays are enable to use.
Warning: The initial value can be defined seting the symbol
CSF_USE_ARRAY_OF_PRIMITIVES to "Yes" or "No"
.

Protected Member Functions

Standard_EXPORT Graphic3d_ArrayOfPrimitives (const Graphic3d_TypeOfPrimitiveArray aType, const Standard_Integer maxVertexs, const Standard_Integer maxBounds, const Standard_Integer maxEdges, const Standard_Boolean hasVNormals, const Standard_Boolean hasVColors, const Standard_Boolean hasBColors, const Standard_Boolean hasTexels, const Standard_Boolean hasEdgeInfos)
 Warning
You must use a coherent set of AddVertex() methods according to the
<hasvnormals>,<hasvcolors>,<hasvtexels>,<hasbcolors>
User is responsible of confuse vertex and bad normal orientation.
You must use AddBound() method only if the <maxbounds>
constructor parameter is > 0.
You must use AddEdge() method only if the <maxedges>
constructor parameter is > 0.
You must use a coherent set of AddEdge() methods according to the
<hasedgeinfos> constructor parameter.
.

Private Member Functions

Standard_EXPORT Standard_Boolean Orientate (const Standard_Integer aVertexIndex, const Standard_Integer aVertexNumber, const gp_Dir &aNormal)
 Orientate correctly a set of vertexs & normal
from <avertexindex> to <avertexindex>+<avertexnumber>-1
according to the <anormal> parameter and
returns TRUE when something has change in the array.
Warning: When the array has edges this method is apply
on edge sub array instead on vertex sub array.
.
Standard_EXPORT void ComputeVNormals (const Standard_Integer fromIndex, const Standard_Integer toIndex)

Private Attributes

Graphic3d_PrimitiveArray myPrimitiveArray
Standard_Integer myMaxBounds
Standard_Integer myMaxVertexs
Standard_Integer myMaxEdges

Constructor & Destructor Documentation

Graphic3d_ArrayOfPrimitives::~Graphic3d_ArrayOfPrimitives  )  [inline]
 

Standard_EXPORT Graphic3d_ArrayOfPrimitives::Graphic3d_ArrayOfPrimitives const Graphic3d_TypeOfPrimitiveArray  aType,
const Standard_Integer  maxVertexs,
const Standard_Integer  maxBounds,
const Standard_Integer  maxEdges,
const Standard_Boolean  hasVNormals,
const Standard_Boolean  hasVColors,
const Standard_Boolean  hasBColors,
const Standard_Boolean  hasTexels,
const Standard_Boolean  hasEdgeInfos
[protected]
 


Member Function Documentation

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound const Standard_Integer  edgeNumber,
const Standard_Real  R,
const Standard_Real  G,
const Standard_Real  B
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound const Standard_Integer  edgeNumber,
const Quantity_Color &  aBColor
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound const Standard_Integer  edgeNumber  ) 
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge const Standard_Integer  vertexIndex,
const Standard_Boolean  isVisible = Standard_True
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex const Standard_Real  X,
const Standard_Real  Y,
const Standard_Real  Z,
const Standard_Real  NX,
const Standard_Real  NY,
const Standard_Real  NZ,
const Standard_Real  TX,
const Standard_Real  TY
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex const gp_Pnt &  aVertice,
const gp_Dir &  aNormal,
const gp_Pnt2d &  aTexel
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex const Standard_Real  X,
const Standard_Real  Y,
const Standard_Real  Z,
const Standard_Real  TX,
const Standard_Real  TY
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex const gp_Pnt &  aVertice,
const gp_Pnt2d &  aTexel
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex const gp_Pnt &  aVertice,
const gp_Dir &  aNormal,
const Quantity_Color &  aColor
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex const Standard_Real  X,
const Standard_Real  Y,
const Standard_Real  Z,
const Standard_Real  NX,
const Standard_Real  NY,
const Standard_Real  NZ
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex const gp_Pnt &  aVertice,
const gp_Dir &  aNormal
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex const gp_Pnt &  aVertice,
const Quantity_Color &  aColor
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex const Standard_Real  X,
const Standard_Real  Y,
const Standard_Real  Z
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex const gp_Pnt &  aVertice  ) 
 

Graphic3d_PrimitiveArray Graphic3d_ArrayOfPrimitives::Array  )  const [inline]
 

Standard_Integer Graphic3d_ArrayOfPrimitives::Bound const Standard_Integer  aRank  )  const [inline]
 

void Graphic3d_ArrayOfPrimitives::BoundColor const Standard_Integer  aRank,
Standard_Real &  R,
Standard_Real &  G,
Standard_Real &  B
const [inline]
 

Standard_EXPORT Quantity_Color Graphic3d_ArrayOfPrimitives::BoundColor const Standard_Integer  aRank  )  const
 

Standard_Integer Graphic3d_ArrayOfPrimitives::BoundNumber  )  const [inline]
 

Standard_EXPORT void Graphic3d_ArrayOfPrimitives::ComputeVNormals const Standard_Integer  fromIndex,
const Standard_Integer  toIndex
[private]
 

Standard_EXPORT void Graphic3d_ArrayOfPrimitives::Destroy  ) 
 

static Standard_EXPORT void Graphic3d_ArrayOfPrimitives::Disable  )  [static]
 

Standard_Integer Graphic3d_ArrayOfPrimitives::Edge const Standard_Integer  aRank  )  const [inline]
 

Standard_Boolean Graphic3d_ArrayOfPrimitives::EdgeIsVisible const Standard_Integer  aRank  )  const [inline]
 

Standard_Integer Graphic3d_ArrayOfPrimitives::EdgeNumber  )  const [inline]
 

static Standard_EXPORT void Graphic3d_ArrayOfPrimitives::Enable  )  [static]
 

Standard_EXPORT const Graphic3d_ArrayOfPrimitives::Handle Standard_Type   )  const
 

Reimplemented in Graphic3d_ArrayOfPoints, Graphic3d_ArrayOfPolygons, Graphic3d_ArrayOfPolylines, Graphic3d_ArrayOfQuadrangles, Graphic3d_ArrayOfQuadrangleStrips, Graphic3d_ArrayOfSegments, Graphic3d_ArrayOfTriangleFans, Graphic3d_ArrayOfTriangles, and Graphic3d_ArrayOfTriangleStrips.

Standard_Boolean Graphic3d_ArrayOfPrimitives::HasBoundColors  )  const [inline]
 

Standard_Boolean Graphic3d_ArrayOfPrimitives::HasEdgeInfos  )  const [inline]
 

Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexColors  )  const [inline]
 

Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexNormals  )  const [inline]
 

Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexTexels  )  const [inline]
 

static Standard_EXPORT Standard_Boolean Graphic3d_ArrayOfPrimitives::IsEnable  )  [static]
 

Standard_EXPORT Standard_Boolean Graphic3d_ArrayOfPrimitives::IsValid  ) 
 

Standard_EXPORT Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber  )  const
 

Standard_EXPORT Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate const Standard_Integer  aVertexIndex,
const Standard_Integer  aVertexNumber,
const gp_Dir &  aNormal
[private]
 

Standard_EXPORT Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate const Standard_Integer  aBoundIndex,
const gp_Dir &  aNormal
 

Standard_EXPORT Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate const gp_Dir &  aNormal  ) 
 

void Graphic3d_ArrayOfPrimitives::SetBoundColor const Standard_Integer  anIndex,
const Standard_Real  R,
const Standard_Real  G,
const Standard_Real  B
[inline]
 

Standard_EXPORT void Graphic3d_ArrayOfPrimitives::SetBoundColor const Standard_Integer  anIndex,
const Quantity_Color &  aColor
 

void Graphic3d_ArrayOfPrimitives::SetVertexColor const Standard_Integer  anIndex,
const Standard_Real  R,
const Standard_Real  G,
const Standard_Real  B
[inline]
 

Standard_EXPORT void Graphic3d_ArrayOfPrimitives::SetVertexColor const Standard_Integer  anIndex,
const Quantity_Color &  aColor
 

void Graphic3d_ArrayOfPrimitives::SetVertexNormal const Standard_Integer  anIndex,
const Standard_Real  NX,
const Standard_Real  NY,
const Standard_Real  NZ
[inline]
 

Standard_EXPORT void Graphic3d_ArrayOfPrimitives::SetVertexNormal const Standard_Integer  anIndex,
const gp_Dir &  aNormal
 

void Graphic3d_ArrayOfPrimitives::SetVertexTexel const Standard_Integer  anIndex,
const Standard_Real  TX,
const Standard_Real  TY
[inline]
 

Standard_EXPORT void Graphic3d_ArrayOfPrimitives::SetVertexTexel const Standard_Integer  anIndex,
const gp_Pnt2d &  aTexel
 

void Graphic3d_ArrayOfPrimitives::SetVertice const Standard_Integer  anIndex,
const Standard_Real  X,
const Standard_Real  Y,
const Standard_Real  Z
[inline]
 

Standard_EXPORT void Graphic3d_ArrayOfPrimitives::SetVertice const Standard_Integer  anIndex,
const gp_Pnt &  aVertice
 

Standard_EXPORT Standard_CString Graphic3d_ArrayOfPrimitives::StringType  )  const
 

Graphic3d_TypeOfPrimitiveArray Graphic3d_ArrayOfPrimitives::Type  )  const [inline]
 

void Graphic3d_ArrayOfPrimitives::VertexColor const Standard_Integer  aRank,
Standard_Real &  R,
Standard_Real &  G,
Standard_Real &  B
const [inline]
 

Standard_EXPORT Quantity_Color Graphic3d_ArrayOfPrimitives::VertexColor const Standard_Integer  aRank  )  const
 

void Graphic3d_ArrayOfPrimitives::VertexNormal const Standard_Integer  aRank,
Standard_Real &  NX,
Standard_Real &  NY,
Standard_Real &  NZ
const [inline]
 

Standard_EXPORT gp_Dir Graphic3d_ArrayOfPrimitives::VertexNormal const Standard_Integer  aRank  )  const
 

Standard_Integer Graphic3d_ArrayOfPrimitives::VertexNumber  )  const [inline]
 

void Graphic3d_ArrayOfPrimitives::VertexTexel const Standard_Integer  aRank,
Standard_Real &  TX,
Standard_Real &  TY
const [inline]
 

Standard_EXPORT gp_Pnt2d Graphic3d_ArrayOfPrimitives::VertexTexel const Standard_Integer  aRank  )  const
 

void Graphic3d_ArrayOfPrimitives::Vertice const Standard_Integer  aRank,
Standard_Real &  X,
Standard_Real &  Y,
Standard_Real &  Z
const [inline]
 

Standard_EXPORT gp_Pnt Graphic3d_ArrayOfPrimitives::Vertice const Standard_Integer  aRank  )  const
 


Field Documentation

Standard_Integer Graphic3d_ArrayOfPrimitives::myMaxBounds [private]
 

Standard_Integer Graphic3d_ArrayOfPrimitives::myMaxEdges [private]
 

Standard_Integer Graphic3d_ArrayOfPrimitives::myMaxVertexs [private]
 

Graphic3d_PrimitiveArray Graphic3d_ArrayOfPrimitives::myPrimitiveArray [private]
 


The documentation for this class was generated from the following files:
Generated on Mon Aug 25 13:55:38 2008 for OpenCASCADE by  doxygen 1.4.1