ODA Product: | ODA PRC SDK |
Sample Name: | OdPrcReadEx |
Categories: | C++ / Beginner / Working with .prc files / Android, iOS, macOS, Linux, Windows |
Source Code Location: | Prc/Examples/OdPrcReadEx |
To run the OdPrcReadEx
sample application, please do the following:
<PRC_DIR>\exe\<version>
<PRC_DIR>/bin/<version>
<PRC_DIR>
is a directory where you unpacked the PRC SDK archive.
To determine your <version>
parameter, please see the
appropriate section
in the Download ODA PRC SDK topic.
OdPrcReadEx <filename>
filename
|
Full path to the input .prc file to be dumped. |
If the application executed properly, you will see the following console window:
If an error occurs during the application execution, you will see an appropriate error message in the console window. For example, the following picture illustrates the program output in the case when it was called with wrong arguments:
The entry point (the main() function) is located in the OdPrcReadEx.cpp file, which contains:
OdPrcListenerImpl
class.
addChilds()
function.
dump()
function.
getObjectId()
function.
The main() function also contains common sections before and after the source code section that illustrate how to dump a .prc file's content to the console window. The main() function does the following:
dump()
function.
Below is the functions call and class instances schema:
main()
|
|-->dump()
|
|-->addChilds()
|
|-->OdPrcListenerImpl class instance
|
|-->getObjectId()
The OdPrcListenerImpl class implements dumping values of different data types to the console window using the odPrintConsoleString() function.
Class methods:
str
.
When dumping bit data, the parameter name is data
.
Calls the addChilds() function with a pointer to an OdPrcFile object as a root of the .prc object hierarchy.
Input parameters:
Dumps information about a specified object and its children. Currently only the names of objects are dumped.
Input parameters:
Common dumping process does the following:
Returns the ID of the specified object. Used for getting identifiers of dumped objects.
Input parameter:
The ID is returned if the specified object can be cast to an instance of the OdPrcReferencedBase, OdPrcBody, or OdPrcFileStructure class. If the object cannot be cast to an instance of one of these classes, an empty ID is returned.
ODA PRC SDK Sample Applications
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|