Beispiel #1
0
bool ON_Font::CreateFontFromFaceName( 
  const wchar_t* facename,
  bool bBold,
  bool bItalic 
  )
{
  PurgeUserData();
  Defaults();

  if ( 0 == facename || 0 == facename[0] )
    facename = L"Arial";

  bool rc = SetFontFaceName(facename);

  HeightOfI();

  m_font_name = facename;
  if ( bBold )
  {
    SetBold(true);
    m_font_name += "L Bold";
  }
  if ( bItalic )
  {
    SetItalic(true);
    m_font_name += "L Italic";
  }

  return rc;
}
void ON_3dmObjectAttributes::Default()
{
  PurgeUserData();
  m_uuid = ON_nil_uuid;
  m_name.Destroy();
  m_url.Destroy();
  m_layer_index = 0;
  m_linetype_index = -1; // continuous
  m_material_index = -1; // white diffuse
  m_rendering_attributes.Default();
  m_color = ON_Color(0,0,0);
  m_plot_color = ON_Color(0,0,0); // Do not change to ON_UNSET_COLOR
  m_display_order = 0;
  m_plot_weight_mm = 0.0;
  m_object_decoration = ON::no_object_decoration;
  m_wire_density = 1;
  m_mode = ON::normal_object;
  m_bVisible = true;
  m_color_source       = ON::color_from_layer;
  m_material_source    = ON::material_from_layer;
  m_linetype_source    = ON::linetype_from_layer;
  m_plot_color_source  = ON::plot_color_from_layer;
  m_plot_weight_source = ON::plot_weight_from_layer;
  m_group.Destroy();
  m_space = ON::model_space;
  m_viewport_id = ON_nil_uuid;
  m_dmref.Destroy();
}
Beispiel #3
0
ON_Object& ON_Object::operator=(const ON_Object& src)
{
  // DO NOT MODIFY this->m_mempool here
  if ( this !=&src ) {
    PurgeUserData();
    CopyUserData(src);
  }
  return *this;
}
Beispiel #4
0
bool ON_UserDataHolder::MoveUserDataTo(  const ON_Object& source_object, bool bAppend )
{
  if ( !bAppend )
  {
    const_cast<ON_Object*>(&source_object)->PurgeUserData();
  }
  const_cast<ON_Object*>(&source_object)->MoveUserData(*this);
  PurgeUserData();
  return (0 != source_object.FirstUserData());
}
Beispiel #5
0
bool ON_UserDataHolder::MoveUserDataFrom( const ON_Object& source_object )
{
  PurgeUserData();
  MoveUserData(*const_cast<ON_Object*>(&source_object));
  return (0 != FirstUserData());
}
Beispiel #6
0
ON_Object::~ON_Object()
{
  PurgeUserData();
}