Made Instanced Version of Stick/Ball Model from Blender Molecular Nodes CSV
This commit is contained in:
parent
704ba31fb9
commit
e658df9854
39 changed files with 2914 additions and 45 deletions
|
|
@ -0,0 +1,52 @@
|
|||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "MoleculeFunctionLibrary.generated.h"
|
||||
|
||||
/**
|
||||
* Struct representing an atom
|
||||
*/
|
||||
USTRUCT(BlueprintType)
|
||||
struct FAtom
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, Category="Molecule")
|
||||
FString Element;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, Category="Molecule")
|
||||
FVector Position; // Unreal coordinates
|
||||
};
|
||||
|
||||
/**
|
||||
* Struct representing a bond
|
||||
*/
|
||||
USTRUCT(BlueprintType)
|
||||
struct FBond
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, Category="Molecule")
|
||||
int32 AtomIndex1;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, Category="Molecule")
|
||||
int32 AtomIndex2;
|
||||
};
|
||||
|
||||
/**
|
||||
* Blueprint Function Library to parse PDB strings
|
||||
*/
|
||||
UCLASS()
|
||||
class UMoleculeFunctionLibrary : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Parses a PDB string and outputs arrays of atoms and bonds
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Molecule")
|
||||
static bool ParsePDBFromString(const FString& PDBContent, TArray<FAtom>& OutAtoms, TArray<FBond>& OutBonds);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue