hxx vor 3 Jahren
Ursprung
Commit
163a153b79
6 geänderte Dateien mit 807 neuen und 3 gelöschten Zeilen
  1. 62 0
      include/HMFCDemoModel.h
  2. 32 0
      include/HMFCDemoView.h
  3. 375 0
      src/HMFCDemoModel.cpp
  4. 45 0
      src/HMFCDemoView.cpp
  5. 257 3
      src/main.cpp
  6. 36 0
      src/unlock_license.cpp

+ 62 - 0
include/HMFCDemoModel.h

@@ -0,0 +1,62 @@
+// HMFCDemoModel.h : interface of the HMFCDemoModel.cpp class, derived from HBaseModel
+// Adds application-specific data and members for each model
+
+#ifndef _HMFCDemoModel_H
+#define _HMFCDemoModel_H
+
+#include "HDB.h"
+#include "HBaseModel.h"
+#include "HTools.h"
+
+#include "ha_bridge.h"
+class CModellerInfo;
+
+class HA_Part;
+
+class ENTITY_LIST;
+
+class HMFCDemoModel : public HBaseModel
+{
+public:
+
+	HMFCDemoModel();
+	virtual ~HMFCDemoModel();
+
+	// Overrides
+	HFileInputResult Read(const char * FileName);
+	bool Write(const char * FileName, HBaseView * pHView, int version, int width = 0, int height = 0);
+
+	void	DeleteAllEntities();
+
+	bool	IsSolidModel(){ return m_bSolidModel; };
+	void	SetSolidModel(bool brep){ m_bSolidModel = brep;};
+	HA_Part* GetHAPart() {return m_pHAPart; };
+
+	void DeleteAcisEntity( ENTITY* entity);
+	void DeleteAcisEntities( ENTITY_LIST& elist);
+
+	void AddAcisEntity( ENTITY* entity);
+	void AddAcisEntitiesToPart( ENTITY_LIST& list);
+	void RemoveAcisEntity( ENTITY* entity);
+	void UpdateAcisEntity( ENTITY* entity);
+	void AddAcisEntities( const ENTITY_LIST& entityList);
+	void GetEntityList(ENTITY_LIST& elist);
+
+	logical Undo();
+	logical Redo();
+	logical CanUndo();
+	logical CanRedo();
+	CModellerInfo *m_mi;
+
+protected:
+
+	HA_Part* m_pHAPart;
+	// do we have any solid modeler entities
+	bool	m_bSolidModel;
+};
+
+#endif
+
+
+
+

+ 32 - 0
include/HMFCDemoView.h

@@ -0,0 +1,32 @@
+// HMFCDemoView.h : interface of the HMFCDemoView class, derived from HBaseView
+// Adds application-specific data and members for each view
+
+#ifndef _HMFCDemoView_H
+#define _HMFCDemoView_H
+
+#include "HBaseView.h"
+#include "HUtility.h"
+
+class HMFCDemoView : public HBaseView
+{
+
+public:
+
+	HMFCDemoView(	HBaseModel *model,
+							const char * 	alias = 0,	
+							const char *	driver_type = 0,
+							const char *	instance_name = 0,
+							void *			window_handle = 0,
+							void *			colormap = 0);
+	virtual ~HMFCDemoView();
+
+	void	Init();
+	//void	DeleteSelectionList(bool emit_message=false);
+
+};
+
+#endif 
+
+
+
+

+ 375 - 0
src/HMFCDemoModel.cpp

@@ -0,0 +1,375 @@
+// HMFCDemoModel.cpp : implementation of the HMFCDemoModel class
+//
+
+// Standard includes
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "ha_part.h"
+#include "ha_part_util.h"
+#include "roll_hm.hxx"
+
+// HOOPS includes
+#include "hc.h"
+#include "HStream.h"
+#include "HOpcodeShell.h"
+#include "HUtility.h"
+#include <part_api.hxx> 
+
+#include "HMFCDemoModel.h"
+#include "HTools.h"
+#include "ha_rend_options.h"
+#include "HIOManager.h"
+#include "varray.h"
+#include "HBaseView.h"
+#include "kernapi.hxx"
+
+HMFCDemoModel::HMFCDemoModel()
+{
+	m_bSolidModel = true;
+	SetBRepGeometry(true);
+	m_mi=0;
+
+	initialize_ha_part();
+	m_pHAPart = ACIS_NEW HA_Part();
+
+	api_part_set_distribution_mode( TRUE );   
+//	distributed_history(TRUE,TRUE);
+
+	char buffer[1024];
+	char pbuffer[POINTER_BUFFER_SIZE];
+	PART* pPart = m_pHAPart->GetPart();
+	sprintf(buffer,"?Include Library/%s",ptoax(pPart->history_stream(), pbuffer));
+	m_ModelKey = HA_KCreate_Segment(0, buffer);
+
+	HA_Set_Rendering_Options("segment pattern = ?Include Library/history/entity");
+}
+
+HMFCDemoModel::~HMFCDemoModel()
+{
+	// Model cleanup : delete all the entities from the 
+	// partition associated with this model
+	DeleteAllEntities();	
+	
+	if(m_pHAPart)
+	{
+		ACIS_DELETE m_pHAPart;
+		m_pHAPart = NULL;
+	}
+	terminate_ha_part();
+
+	if(m_mi)
+	{
+		delete m_mi;
+		m_mi = 0;
+	}
+}
+
+// Delete all the entities in the current model from the 
+// modeler and associated HOOPS geometry
+void HMFCDemoModel::DeleteAllEntities()
+{
+// 	HA_Delete_Entity_Geometry(m_entityList);
+// 	api_del_entity_list(m_entityList);
+// 	m_entityList.clear();
+	ENTITY_LIST elist;
+	m_pHAPart->GetPart()->get_entities(elist);
+	elist.init();
+	ENTITY* pEnt = NULL;
+	while((pEnt= elist.next())!= NULL)
+	{
+		m_pHAPart->RemoveEntity(pEnt);
+	}
+	api_del_entity_list(elist);
+	elist.clear();
+}
+
+// 10/20/2010 mwu :  
+void HMFCDemoModel::AddAcisEntity( ENTITY* entity )
+{
+// 	if(m_pHAPart)
+// 	{
+// 		m_pHAPart->AddEntity(entity);
+// 	}
+ 
+	if(m_pHAPart)
+	{
+		outcome result = api_facet_entity( entity);
+		m_pHAPart->AddEntity(entity);
+	}
+}
+
+
+#include "af_api.hxx"
+
+void HMFCDemoModel::AddAcisEntitiesToPart( ENTITY_LIST& list)
+{
+	if(m_pHAPart)
+	{
+		outcome result = api_facet_bodies( list);
+		ENTITY* entity = list.first();
+		while (entity)
+		{
+			m_pHAPart->AddEntity(entity);
+			entity = list.next();
+		}
+	}
+}
+
+
+
+void HMFCDemoModel::RemoveAcisEntity( ENTITY* entity )
+{
+	if(m_pHAPart)
+	{
+		m_pHAPart->RemoveEntity(entity);
+	}
+}
+
+void HMFCDemoModel::UpdateAcisEntity( ENTITY* entity )
+{
+	if(m_pHAPart)
+	{
+		m_pHAPart->UpdateEntity(entity);
+	}
+}
+
+void HMFCDemoModel::AddAcisEntities( const ENTITY_LIST& entityList )
+{
+	if(m_pHAPart)
+	{
+		m_pHAPart->AddEntities(entityList);
+	}
+}
+
+void HMFCDemoModel::DeleteAcisEntity( ENTITY* entity)
+{
+	// delete from ACIS 
+	if (m_pHAPart)
+	{
+		m_pHAPart->RemoveEntity(entity);
+	}
+	api_del_entity(entity);
+}
+
+void HMFCDemoModel::DeleteAcisEntities( ENTITY_LIST& elist)
+{
+	// delete from HOOPS
+//	HA_Delete_Entity_Geometry(elist);
+	// delete from ACIS 
+	elist.init();
+	ENTITY* pEnt = NULL;
+	while((pEnt = elist.next()) != NULL)
+	{
+		m_pHAPart->RemoveEntity(pEnt);
+	}
+
+	api_del_entity_list(elist);
+}
+
+// our application-specific read function
+HFileInputResult HMFCDemoModel::Read(const char * FileName) 
+{   
+
+	unsigned int i;
+	HFileInputResult success = InputOK;
+
+	// get the file extension
+	char extension[120]; 
+	HUtility::FindFileNameExtension(FileName, extension);
+
+	// read the file into the model object's model segment
+    HC_Open_Segment_By_Key(m_ModelKey);	
+		HC_Open_Segment("main");
+
+			if  (streq(extension,"sat"))
+			{  
+				m_bSolidModel = true;
+				SetBRepGeometry(true);
+//				m_pHAPart->LoadFile(FileName,true);
+
+				int depth = 0;
+				outcome result;
+				api_part_start_state(depth);
+				{
+					API_BEGIN
+					{
+						ENTITY_LIST elist;
+					    FILE * fp = NULL;
+						logical res = TRUE;
+						fp = fopen(FileName, "r");
+						res = (fp != NULL);
+						if (res)
+						{
+							result = api_restore_entity_list(fp, TRUE, elist);
+							res = result.ok();
+						}
+						if (fp)
+							fclose(fp);
+
+						if (res)
+						{
+							ENTITY* entity = 0;
+							elist.init();
+							while ((entity = elist.next()) != 0)
+								AddAcisEntity(entity);
+						}
+					}
+					API_END
+				}
+				api_part_note_state(result, depth);
+			} 
+			else if  (streq(extension,"sab"))
+			{  
+				m_bSolidModel = true;
+				SetBRepGeometry(true);
+//				m_pHAPart->LoadFile(FileName,false);
+
+				int depth = 0;
+				outcome result;
+				api_part_start_state(depth);
+				{
+					API_BEGIN
+					{
+						ENTITY_LIST elist;
+						FILE * fp = NULL;
+						logical res = TRUE;
+						fp = fopen(FileName, "r");
+						res = (fp != NULL);
+						if (res)
+						{
+							result = api_restore_entity_list(fp, FALSE, elist);
+							res = result.ok();
+						}
+						if (fp)
+							fclose(fp);
+						
+						if (res)
+						{
+							ENTITY* entity = 0;
+							elist.init();
+							while ((entity = elist.next()) != 0)
+								AddAcisEntity(entity);
+						}
+					}
+					API_END
+				}
+				api_part_note_state(result, depth);
+			} 
+			else if (streq(extension,"asf"))
+			{
+				m_bSolidModel = true;
+				SetBRepGeometry(true);
+
+				HStreamFileToolkit tk;
+				TK_Status status = HTK_Read_Stream_File( FileName, &tk ); 
+				if( status != TK_Complete )
+					success = InputFail;
+			}
+			else
+			{
+				// No special read - let the base class handle
+				m_bSolidModel = false;
+				success = HBaseModel::Read(FileName);
+			}
+
+ 		HC_Close_Segment();
+    HC_Close_Segment();
+
+    return success;
+}
+
+// our application-specific write function
+bool HMFCDemoModel::Write(const char * FileName, HBaseView * view, 
+									int version, int width, int height) 
+{   
+
+	unsigned int i;
+	bool success = true;
+ 
+	// get the file extension
+	char extension[120]; 
+	HUtility::FindFileNameExtension(FileName, extension);
+
+	if (streq(extension,"sat"))
+	{
+		ENTITY_LIST savelist;
+		GetEntityList(savelist);
+
+		if (savelist.count() > 0)
+			HA_Write_Sat_File(FileName, savelist);
+	}
+	else if (streq(extension,"png"))
+	{
+		HOutputHandlerOptions options;
+		VCharArray width_str(128), height_str(128), temp(128), xpixels_str(128);
+		HC_Open_Segment_By_Key(view->GetViewKey());
+			/* Get the size in milimeters. */
+			HC_Show_Device_Info(".", "size", temp);
+			HC_Parse_String(temp, ",", 0, width_str);
+			HC_Parse_String(temp, ",", 1, height_str);
+
+			/* Get the pixels in the x direction so we can find DPI. */
+			HC_Show_Device_Info(".", "pixels", temp);
+			HC_Parse_String(temp, ",", 0, xpixels_str);
+		HC_Close_Segment();
+
+		/* Save off the window width and height in inches. */
+		options.WindowWidth(atof(width_str)/2.54f);
+		options.WindowHeight(atof(height_str)/2.54f);
+
+		/* DPI = xpixels / width in inches; */
+		options.ImageDpi(atoi(xpixels_str) / options.WindowWidth());	
+
+		HBaseModel::WriteWithOptions(FileName, view, &options);
+	}
+	else
+	{
+		if(!HBaseModel::Write(FileName, view, width, height))
+			success = false;
+	}
+ 
+    return success;
+}
+
+logical HMFCDemoModel::Undo()
+{
+	return m_pHAPart->RollBack();
+}
+
+logical HMFCDemoModel::Redo()
+{
+	return m_pHAPart->RollForward();
+}
+
+logical HMFCDemoModel::CanUndo()
+{
+	PART* pPart = m_pHAPart->GetPart();
+	HISTORY_STREAM* hs = pPart->history_stream();
+	if (hs)
+		return (hs->can_roll_back()!=0);
+	return false;
+}
+
+logical HMFCDemoModel::CanRedo()
+{
+	PART* pPart = m_pHAPart->GetPart();
+	HISTORY_STREAM* hs = pPart->history_stream();
+	if (hs)
+		return (hs->can_roll_forward()!=0);
+	return false;
+}
+
+void HMFCDemoModel::GetEntityList(ENTITY_LIST& elist)
+{
+	if (m_pHAPart != NULL)
+	{
+		PART* pPart = m_pHAPart->GetPart();
+		if(pPart != NULL)
+		{
+			pPart->get_entities(elist);
+		}
+	}
+}

+ 45 - 0
src/HMFCDemoView.cpp

@@ -0,0 +1,45 @@
+// HMFCDemoView.cpp : implementation of the HMFCDemoView class
+// 
+
+// Standard includes
+#include <assert.h>
+#include <math.h>
+#include "hc.h"
+#include "part_api.hxx"
+#include "HMFCDemoView.h"
+#include "HMFCDemoModel.h"
+//#include "HMFCDemoSelectionSet.h"
+
+#include "ha_bridge.h"
+
+
+
+HMFCDemoView::HMFCDemoView(HBaseModel *model,
+    const char * 		alias,	
+    const char *		driver_type,
+    const char *		instance_name,
+    void *				window_handle,
+    void *				colormap) : HBaseView(model, alias, driver_type, instance_name, window_handle, colormap)
+
+{
+}
+
+HMFCDemoView::~HMFCDemoView()
+{
+}
+
+
+// app-specific init function
+void HMFCDemoView::Init()
+{
+	// call base's init function first to get the default HOOPS hierarchy for the view
+	HBaseView::Init();
+
+	// create our app-specific Selection object and initialize
+	//m_pSelection = new HMFCDemoSelectionSet(this);
+ //   m_pSelection->Init();
+
+	// TODO: Add your initialization here
+}
+
+

+ 257 - 3
src/main.cpp

@@ -3,9 +3,263 @@
 #include <iostream>
 #include "test.h"
  
-int main(int argc, char** argv)
+// int main(int argc, char** argv)
+// {
+//     myprint();
+//     system("pause");
+//     return 0;
+// }
+// MyfirstAcisProject.cpp : Defines the entry point for the console application.
+//
+#include "acis.hxx"
+#include "kernapi.hxx"
+#include "lists.hxx"
+#include "acistype.hxx"
+#include "fileinfo.hxx"
+#include "position.hxx" 
+#include "body.hxx"
+#include "cstrapi.hxx"
+#include "license.hxx"
+#include "spa_unlock_result.hxx"
+
+#include "hc.h"
+#include <HDB.h>
+
+#include "HBaseView.h"
+#include "HBaseModel.h"
+#include "ha_bridge.h"
+#include <HIOManager.h>
+#include "varray.h"
+#include "HMFCDemoModel.h"
+#include "HMFCDemoView.h"
+#include "hoops_license.h"
+#include "part_api.hxx"
+void		process(outcome result);
+void		process_file(FILE* fp);
+ENTITY_LIST	retrieve_sat_file(char *fileName);
+void		create_sat_file(ENTITY *ent, char *fileName);
+void		create_sat_file(ENTITY_LIST elist, char *fileName);
+void		Initialize_ACIS();
+void		Terminate_ACIS();
+void	    Check_Entity(ENTITY* input);
+void  		unlock_license();
+void		doSometing();
+int main()
 {
-    myprint();
-    system("pause");
+	
+	Initialize_ACIS();
+	//add unlock license key here; refer to the "Application Licensing" article
+	unlock_license();
+	doSometing();
+
+	//add ACIS calls here
+	Terminate_ACIS();
     return 0;
 }
+
+int saveImage()
+{
+	HC_Define_System_Options("license = `" VISUALIZE_LICENSE "`");
+	HDB gHDB;
+	gHDB.Init();
+	gHDB.SetIsolatedDrivers(true);
+	HMFCDemoModel *modelPlane = new HMFCDemoModel();
+	//modelPlane->Init();
+	HMFCDemoView view(modelPlane,NULL,"opengl");
+	view.Init();
+	view.FitWorld();
+	view.GetModel();
+	HC_KEY model_key = modelPlane->GetModelKey();
+	HC_Open_Segment_By_Key(model_key);
+		HC_Open_Segment("");
+			ENTITY_LIST entityList;
+			BODY* sphere = NULL;
+			api_solid_sphere(SPAposition(0, 0, 0), 1, sphere, NULL);
+			entityList.add(sphere);
+
+
+			HA_Render_Entities(entityList);
+			((HMFCDemoModel*)(view.GetModel()))->AddAcisEntity(sphere);
+
+
+				//static HPoint point_list[8] = {
+				//	{ -0.4f, -0.4f, -0.4f },
+				//	{ 0.4f, -0.4f, -0.4f },
+				//	{ 0.4f, 0.4f, -0.4f },
+				//	{ -0.4f, 0.4f, -0.4f },
+				//	{ -0.4f, -0.4f, 0.4f },
+				//	{ 0.4f, -0.4f, 0.4f },
+				//	{ 0.4f, 0.4f, 0.4f },
+				//	{ -0.4f, 0.4f, 0.4f } };
+				//static int face_list[30] = {
+				//	4, 0, 1, 2, 3,
+				//	4, 4, 5, 1, 0,
+				//	4, 2, 1, 5, 6,
+				//	4, 7, 4, 0, 3,
+				//	4, 7, 6, 5, 4,
+				//	4, 3, 2, 6, 7 };
+				//HC_Insert_Shell(8, point_list, 30, face_list);
+				//HC_Rotate_Object(75.0, 0.0, 0.0);//旋转
+				//HC_Translate_Object(-0.5, 0.0, 0.0);//平移
+				//HC_Set_Visibility("no markers, no faces");//没有材质、没有面
+		HC_Close_Segment();
+	HC_Close_Segment();
+
+	modelPlane->Write("E://w.png",&view,1,400, 400);
+
+	
+	//HOutputHandlerOptions options;
+	//VCharArray width_str(128), height_str(128), temp(128), xpixels_str(128);
+	//HC_Open_Segment_By_Key(view.GetViewKey());
+	///* Get the size in milimeters. */
+	//HC_Show_Device_Info(".", "size", temp);
+	//HC_Parse_String(temp, ",", 0, width_str);
+	//HC_Parse_String(temp, ",", 1, height_str);
+
+	///* Get the pixels in the x direction so we can find DPI. */
+	//HC_Show_Device_Info(".", "pixels", temp);
+	//HC_Parse_String(temp, ",", 0, xpixels_str);
+	//HC_Close_Segment();
+
+	///* Save off the window width and height in inches. */
+	//options.WindowWidth(atof(width_str) / 2.54f);
+	//options.WindowHeight(atof(height_str) / 2.54f);
+
+	//modelPlane->WriteWithOptions("E://t.png", &view, &options);
+	
+	return 0;
+}
+void  doSometing()
+{	
+
+	saveImage();
+	//outcome result;
+	//FileInfo fileinfo;
+	//fileinfo.set_units(1.0);
+	//fileinfo.set_product_id("ACIS (c) SPATIAL");
+	//result = api_set_file_info(3, fileinfo);
+	//process(result);
+	//ENTITY_LIST entityList;
+	//// Create a Sphere.
+	//BODY* sphere = NULL;
+	//api_solid_sphere(SPAposition(30, 30, 30), 10, sphere, NULL);
+	//entityList.add(sphere);
+	//// Create a SAT File.
+	//create_sat_file(entityList, "E:/MyFirstAcisProject2.sat");
+	//HA_Set_Rendering_Options("RenderEdgesMode=on/off");
+	//char buffer[1024];
+	//HA_Render_Entities(entityList);
+	
+}
+
+void Initialize_ACIS()
+{
+	/*initialize_base();
+	api_start_modeller(0);
+	api_initialize_hoops_acis_bridge();*/
+	base_configuration base_config;
+	logical ok = initialize_base(&base_config);
+	api_start_modeller(0);
+	api_initialize_hoops_acis_bridge();
+	api_initialize_part_manager();
+	api_set_int_option("annotations", false);
+	api_set_int_option("cell_recompute", 8);
+	
+}
+
+void Terminate_ACIS()
+{	
+
+	api_terminate_part_manager();
+	api_terminate_hoops_acis_bridge();
+	api_stop_modeller();
+	terminate_base();
+}
+
+void process(outcome result)
+{
+	if (!result.ok())
+	{
+		print_warnerr_mess("API", result.error_number(), stdout);
+	}
+	err_mess_type* warnings = NULL;
+	int nwarn = get_warnings(warnings);
+	for (int i = 0; i < nwarn; ++i)
+	{
+		printf("Warning %d : %s\n", warnings[i], find_err_mess(warnings[i]));
+	}
+}
+
+void process_file(FILE* fp)
+{
+	if (!fp)
+	{
+		printf("Unable to open input/output File\n");
+		exit(0);
+	}
+}
+
+ENTITY_LIST retrieve_sat_file(char *fileName)
+{
+	outcome result;
+	// NOTE: to retrieve a binary sab file, use the following code:
+	//  FILE *input_file = fopen (fileName, "rb");
+	FILE *input_file = fopen(fileName, "r");
+	process_file(input_file);
+
+	ENTITY_LIST elist;
+	result = api_restore_entity_list(input_file, TRUE, elist);
+	process(result);
+	fclose(input_file);
+
+	return elist;
+}
+
+void create_sat_file(ENTITY *ent, char *fileName)
+{
+	outcome result;
+
+	// Setting the units and product_id
+
+	FileInfo fileinfo;
+
+	fileinfo.set_units(1.0);
+	fileinfo.set_product_id("ACIS (c) SPATIAL");
+
+	result = api_set_file_info(3, fileinfo);
+	process(result);
+
+	FILE *output_file = fopen(fileName, "w");
+	process_file(output_file);
+
+	ENTITY_LIST save_list;
+	save_list.add(ent);
+
+	result = api_save_entity_list(output_file, TRUE, save_list);
+	process(result);
+
+	fclose(output_file);
+}
+
+void create_sat_file(ENTITY_LIST elist, char *fileName)
+{
+	outcome result;
+
+	// Setting the units and product_id
+
+	FileInfo fileinfo;
+
+	fileinfo.set_units(1.0);
+	fileinfo.set_product_id("ACIS (c) SPATIAL");
+
+	result = api_set_file_info(3, fileinfo);
+	process(result);
+
+	FILE *output_file = fopen(fileName, "w");
+	process_file(output_file);
+
+	result = api_save_entity_list(output_file, TRUE, elist);
+	process(result);
+
+	fclose(output_file);
+}

+ 36 - 0
src/unlock_license.cpp

@@ -0,0 +1,36 @@
+/*******************************************************************/
+/*    Copyright (c) 2006-2020 by Spatial Corp.                     */
+/*    All rights reserved.                                         */
+/*    Protected by U.S. Patents 5,257,205; 5,351,196; 6,369,815;   */
+/*                              5,982,378; 6,462,738; 6,941,251    */
+/*    Protected by European Patents 0503642; 69220263.3            */
+/*    Protected by Hong Kong Patent 1008101A                       */
+/*******************************************************************/
+#include "base.hxx"
+
+#ifdef _MSC_VER
+#include "license.hxx"
+#include "spa_unlock_result.hxx"
+
+// place the spatial_license.h file from the download site in include folder
+//#include "spatial_license.h"
+void unlock_license()
+{
+	spa_unlock_result out = spa_unlock_products("3VKKZ85TA8QRNSJT3HK3EC5NE82UJE5XPRLDVETLKCJUKNJZTCEUJH5EKRMKKQTVKCVCGEJQ9A8UJN5HRR8DDSHHK8JCMA57HX2ZMEJ7QRACJZJWW8M3KGMLRCUDD85RR85ZMD5WQLZUJJPUS8PUNDPWACP7V8HXTLPUJ8JC98MRGG5L7ALDVZTV3LLZGCMAR3K3AZH8VRRZAZM7A8S7EJN7QH2CSS2JKERDFE2B3HJKZ85NQR3FWN2H7V8FFQDFA3D3A8JUVGJLDAHNN8Q7VA5SJ8CNEQDQ3GNMMZ22PEQREZ5NHAHCDWDRTVVFPY87VVCAEQD8TECFFHXLPEDFWD2B7VQ7EZ5TN8Q3JHBBKEGCSU2DKRRFWAXNA8QRGJNSW8QRMYHZPAECKHP6TA5CD8P6PR6ZKYHTH8N3A85Z3CVUBZHZTANZPJNSW8Q7EAHAPR4UNZHZVCPDJEJ67APZMSHTHXQ7EAHAPR4ZDCHETACAE85NE8HZJUJ63R7DNYTHPASCNJNSN8Q7EAHAPR4ZDDT39LJCKATRTACAEQ5NE8HZJUJ6KCTZPHPQR3K3VQD7NANCMYTCPAJDJZJ63RNUNJQ7Q8QRDWHCPADUMQP6KARDJCJ3KC4UJCPHKCTDZQ5NACTF7EH29EQKKJQSQHTZYQX5KVX5AEHTS8QRKNXSKA359C8NA8N3EQMBQ8K7LQMSA3D3AQPUREELU82TPE75AZMSA8Q7EETC78P7D85LRAXDKAMCKCSKJNPRV8NCMSH57RZZGEMR7ATDMCJZVAPZ2N53P83C2WJ8P8MRPZHFNRGUJSJ3TAMCVHHV3XHDEJH3VRCCPAM5PCTCPSH3KAAUPCH5VRKCNGJ8PA8UPAHWEC3UDG5US8AZPEJWNCUUKNM57AUZA85LV8KCJJTTH8QRNS2M7CTMW8BJ9VG5AQ5TH8QRNSJT7CTMW8BJ9VG5AQ5T");
+	if (out.get_state() == SPA_UNLOCK_PASS_WARN)
+	{ /* insert your warning notification code here */;
+	}
+	else if (out.get_state() != SPA_UNLOCK_PASS)
+	{ /* insert your error handling code here */;
+	}
+}
+
+#else
+
+// Non licensing platforms
+void unlock_license()
+{
+}
+
+#endif
+